使用 GNU 汇编器汇编文件时,出现以下错误:
hello.s:6:错误:“push”的指令后缀无效
这是我要组装的文件:
.text
LC0:
.ascii "Hello, world!\12\0"
.globl _main
_main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
andl $-16, %esp
movl $0, %eax
movl %eax, -4(%ebp)
movl -4(%ebp), %eax
call __alloca
call ___main
movl $LC0, (%esp)
call _printf
movl $0, %eax
leave
ret
这里有什么问题,我该如何解决?
尽管问题中的错误和说明有所不同,但该问题与此问题有些相关。