Created
March 10, 2019 01:53
-
-
Save kitsune7/1405efcacc7e1b95928c2b22fc66627a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ; My first linux assembly program (runs on 64 bit linux) | |
| ; Compile with `nasm -felf64 hello.asm && ld hello.o -o hello` | |
| global _start | |
| section .text | |
| _start: | |
| ; Call 'write' system call | |
| mov rax, 1 | |
| mov rdi, 1 | |
| mov rsi, message | |
| mov rdx, 14 | |
| syscall | |
| ; Call 'exit' with status 0 | |
| mov rax, 60 | |
| mov rdi, 0 | |
| syscall | |
| section .rodata | |
| message: db "Hello, world!", 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment