Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Created May 4, 2014 20:52
Show Gist options
  • Save tetsuok/8f87b3a8caf037051520 to your computer and use it in GitHub Desktop.
Save tetsuok/8f87b3a8caf037051520 to your computer and use it in GitHub Desktop.
; http://farid.hajji.name/blog/2009/12/26/hello-world-in-freebsd-assembler/
.type main,@function
.data
msg:
.ascii "Hello, world\n"
.text
.globl main
main:
movl $14, %edx
movq $msg, %rsi
movl $0, %edi
movq $4, %rax
movq %rcx, %r10
syscall
movl $0, %edi
movq $1, %rax
movq %rcx, %r10
syscall
@tetsuok
Copy link
Author

tetsuok commented May 5, 2014

$ as --64 -o hello_world_freebsdx86_64.o hello_world_freebsdx86_64.s
$ ld hello_world_freebsdx86_64.o
$ ./a.out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment