Skip to content

Instantly share code, notes, and snippets.

@kitsune7
Created March 10, 2019 01:53
Show Gist options
  • Select an option

  • Save kitsune7/1405efcacc7e1b95928c2b22fc66627a to your computer and use it in GitHub Desktop.

Select an option

Save kitsune7/1405efcacc7e1b95928c2b22fc66627a to your computer and use it in GitHub Desktop.
; 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