AT&T Assembly for Linux and Mac (sys_exit)

Exit() in C : (sys_exit.c)

int main(void)
{
    return 99; 
}

Exit() in AT&T for Linux: (sys_exit.s)

.section .data

.section .text

.globl _start

_start:

        movl    $1,     %eax    #sys_call number
        movl    $99,    %ebx    #_return value

        int             $0x80           #intrrupt number

Exit() in AT&T for Mac: (sys_exit.s):

.globl _main

_main:

    movl    $99,    %eax
    ret 

Can we drop this masquerade
原文地址:https://www.cnblogs.com/landpack/p/4430303.html