Skip to content

Instantly share code, notes, and snippets.

@hgiesel
Last active April 16, 2016 22:17
Show Gist options
  • Save hgiesel/1b7050390cae11231a524f7e025eb7de to your computer and use it in GitHub Desktop.
Save hgiesel/1b7050390cae11231a524f7e025eb7de to your computer and use it in GitHub Desktop.
x86_64 syscall in GAS at&t syntax on OS X
.globl start
.cstring
str:
.asciz "Hello World!\n"
str_length:
.set str_lngth, .-str
.text
start:
movq $0x2000004, %rax
movq $1, %rdi
movq str@GOTPCREL(%rip), %rsi
movq str_length@GOTPCREL(%rip), %rdx
syscall
movq $0x2000001, %rax
movq $0, %rdi
syscall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment