Skip to content

Instantly share code, notes, and snippets.

@asantos2000
Last active June 26, 2019 14:55
Show Gist options
  • Save asantos2000/9a0c3b1799ead721b99b983ed1401734 to your computer and use it in GitHub Desktop.
Save asantos2000/9a0c3b1799ead721b99b983ed1401734 to your computer and use it in GitHub Desktop.
; /usr/local/bin/nasm -f macho64 hello.s && ld -macosx_version_min 10.7.0 -lSystem -o 64 hello.o && ./hello
global start
section .text
start:
mov rax, 0x2000004 ; write
mov rdi, 1 ; stdout
mov rsi, msg
mov rdx, msg.len
syscall
mov rax, 0x2000001 ; exit
mov rdi, 0
syscall
section .data
msg: db "Hello, world!", 10
.len: equ $ - msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment