我有以下x86代码:
.section .rodata
.text
subl $440, %esp
movl %esp, %ecx
subl $24, %esp
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
andl $-16, %esp
movl $1, %eax
movl $4, %edx
imul %edx, %eax
movl $2, %edx
addl %ecx, %eax
movl %edx, 24(%eax)
movl $0, %eax
nop
leave
ret
.size main, .-main
使用gcc编译时,此程序会提供segmentation fault (Core Dumped)
。但是,删除movl %edx, 24(%eax)
会删除错误。我是集会新手,请告诉我我做错了什么。