Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 GNU Assembler 的新手,我正在尝试执行这段代码:
.globl _main _main: movl $1, %eax movl $0, %ebx int $0x80
该程序应通过系统调用 exit ( 1) 退出。编译它(没有警告):
1
gcc test.s
但是运行它会给我错误:Illegal instruction: 4
Illegal instruction: 4
感谢帮助!
如果您正在编译 64 位可执行文件,那么您应该编写如下内容:
movq $0x2000001, %rax movq $0, %rdi syscall
来源。