Skip to content

Instantly share code, notes, and snippets.

@pstephens
Created December 11, 2016 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pstephens/71a94256314a2c75b16b592a121c6f68 to your computer and use it in GitHub Desktop.
Save pstephens/71a94256314a2c75b16b592a121c6f68 to your computer and use it in GitHub Desktop.
My first assembler program on Linux :-)
section .text
global _start
_start:
mov rdi, 42
mov rax, 60 ; sys_exit
syscall
; assemble the elf64 object file with nasm:
; nasm -f elf64 theanswer.asm
; and then link to a binary with ld:
; ld -e _start -o theanswer theanswer.o
@pstephens
Copy link
Author

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