【发布时间】:2013-11-28 04:03:27
【问题描述】:
我目前正在尝试在我的标题中发布的情况下自学 x86。请注意,我不只是想要一个答案,我想学习并精通它。
在主寄存器以外的内存地址(eax、ebx、ecx、edx)中存储数据时遇到了很多麻烦。
.global main
.text
str: .string "data: %d\n"
main:
pushl $3
call malloc
popl %ecx
movl $4, %esi #source
movl %eax, %edi #destination
stosb
movl %eax, %esi
lodsb
pushl %edi
pushl $str
call printf
popl %ecx
popl %ecx
在stosb之后,不应该movl将目的地址(由malloc产生的内存地址和原始源地址)放入目的地址,并将%esi中的$4移回%edi?
【问题讨论】: