Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I spent a bit getting it to work on OS X. The ASM becomes:

    movq $0x2000004, %rax  ; // BSD syscalls are divided into classes.
    movq $1, %rdi          ; // 64-bit registers use %rdi instead of %ebx
    lea message(%rip), %rsi; // Relative Address of message
    movq $13, %rdx         ; // Same Length
    syscall                ; // x86-64 ASM syscall

    movq $0x2000001, %rax  ; // Exit Syscall
    movq $0, %rdi;
    syscall

    message: .ascii "Hello World!\n";


Nice. Thx.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: