Skip to content

Instantly share code, notes, and snippets.

@mattheusv
Created June 19, 2019 02:55
Show Gist options
  • Save mattheusv/ff262d60305d900785d65bf82113c2d3 to your computer and use it in GitHub Desktop.
Save mattheusv/ff262d60305d900785d65bf82113c2d3 to your computer and use it in GitHub Desktop.
Hello World with Assembly
section .data
text db "Hello World",10
section .text
global _start
_start:
mov rax, 1
mov rdi, 1
mov rsi, text
mov rdx, 14
syscall
mov rax, 60
mov rdi, 0
syscall
@mattheusv
Copy link
Author

Requirements

  • nasm assembly compiler

Compile and Run

  • $ nasm -f elf64 -o hello.o hello.asm
  • $ ld hello.o -o hello
  • $ ./hello

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