0
我在下面的代码中遇到了段错误。汇编代码中的段错误
.section .data
myarray:
.int 10,20,30,40,50,60
format:
.ascii "%d\n"
.section .text
.globl _start
_start:
movl $2, %ebx
movl myarray(,%ebx,4) , %ecx
pushl %ecx
pushl $format
addl $8,%esp
call printf
movl $1,%eax
movl $0,%ebx
int $0x80
而在gdb下运行,我越来越
Program received signal SIGSEGV, Segmentation fault.
strchrnul() at ../sysdeps/i386/strchrnul.S:68
68 ../sysdeps/i386/strchrnul.S: No such file or directory.
in ../sysdeps/i386/strchrnul.S
请点我要去的地方错了。
完美!我正在学esp今天需要的堆栈操作,所以我错过了它的位置。感谢您的努力和时间。我正在使用linux和gnu汇编器进行实践。 –