Created
December 11, 2016 05:18
-
-
Save pstephens/71a94256314a2c75b16b592a121c6f68 to your computer and use it in GitHub Desktop.
My first assembler program on Linux :-)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some reference material:
nasm documentation
AMD 64 instruction set documentation
Hello, world!
Linux x64 syscall reference