Comment

Comment by 0x44

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";
parent 0x44 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton