Skip to content

Instantly share code, notes, and snippets.

@ljmccarthy
Created August 26, 2022 15:45
Show Gist options
  • Save ljmccarthy/ecce06f1a9095b970bb4a4806766a22f to your computer and use it in GitHub Desktop.
Save ljmccarthy/ecce06f1a9095b970bb4a4806766a22f to your computer and use it in GitHub Desktop.
Flat Assembler Hello World (Linux x86-64)
format ELF64 executable 3
segment readable executable
entry $
mov eax, 1 ; sys_write
mov edi, 1 ; fd = STDOUT_FILENO
mov rsi, message ; buf
mov rdx, message.end - message ; count
syscall
mov eax, 60 ; sys_exit
xor rdi, rdi ; status = 0
syscall
message: db "hello, world", 10
.end:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment