Why does this print garbage instead of exiting my program gracefully? I use system calls this way on BSD, and I wonder what would I need to make it work in Linux.

int
main(int argc, char **argv)
{
    __asm ("movq $1,%rax; movq $0,%rdi; syscall"); /* exit(0) ? */
    return 0;
}

Thanks.

Edit
Report