linux平台学x86汇编(十二):字符串的存储与加载
# stos.s .section .data space: .ascii " " .section .bss .lcomm buffer, 256 .section .text .globl _start _start: nop leal space, %esi leal buffer, %edi movl $256, %ecx cld lodsb rep stosb movl $1, %eax movl $0, %ebx int $0x80
Breakpoint 1, _start () at stos.s:11 11 nop (gdb) print/x $eax $1 = 0x0 (gdb) x/16b &buffer 0x80490a0 <buffer>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80490a8 <buffer+8>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 (gdb) s 12 leal space, %esi (gdb) s 13 leal buffer, %edi (gdb) s 14 movl $256, %ecx (gdb) s 16 cld (gdb) s 17 lodsb (gdb) s 18 rep stosb (gdb) print/x $eax $4 = 0x20 (gdb) s 20 movl $1, %eax (gdb) s 21 movl $0, %ebx (gdb) x/16b &buffer 0x80490a0 <buffer>: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x80490a8 <buffer+8>: 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 (gdb)
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。