movl $output, %edi
leal output, %edi #把 output 标签的 32 位内存位置加载到 EDI
.section .data
value1:
.ascii "This is a test string.\n"
.section .bss
.lcomm output, 23
.section .text
.global _start
_start:
nop
leal value1, %esi
leal output, %edi
movsb
movsw
movsl
movl $1, %eax
movl $0, %ebx
int $0x80
(gdb) n
16 movsb
(gdb) n
17 movsw
(gdb) n
18 movsl
(gdb) x/s &output
0x80490b0 <output>: "Thi"
(gdb) n
20 movl $1, %eax
(gdb) x/s &output
0x80490b0 <output>: "This is"
.section .data
value1:
.ascii "This is a test string.\n"
.section .bss
.lcomm output, 23
.section .text
.global _start
_start:
nop
leal value1+22, %esi
leal output+22, %edi
std
movsb
movsw
movsl
movl $1, %eax
movl $0, %ebx
int $0x80
(gdb) x/23b &output
0x80490b0 <output>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x80490b8 <output+8>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x80490c0 <output+16>: 0x00 0x00 0x00 0x6e 0x67 0x2e 0x0a
.section .data
value1:
.ascii "This is a test string.\n"
.section .bss
.lcomm output, 23
.section .text
.global _start
_start:
nop
leal value1, %esi
leal output, %edi
movl $23, %ecx
loop1:
movsb
loop loop1
movl $1, %eax
movl $0, %ebx
int $0x80
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |