|
|
|
|
|
by 0x44
4158 days ago
|
|
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";
|
|