leave-ret 和系统调用退出有什么区别?

时间:2021-06-12 15:10:05

标签: linux assembly system-calls exit gnu-assembler

leave-ret 和 system call exit 有什么区别? 因此,我在 Ubuntu 20.04 中使用带有 gcc 编译器的 GNU 汇编程序,当我使用以下命令将 c 程序转换为汇编程序时:

gcc -S foo.c

foo.s 文件总是以此代码结尾:

leave
ret

我应该使用系统调用 exit 而不是 leave 和 ret 吗?像这样:

movl $1, %eax
movl $0, %ebx
int $0x80

0 个答案:

没有答案