Skip to content

Instantly share code, notes, and snippets.

@yasaichi
Last active August 15, 2020 12:06
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 yasaichi/3a57959491546500db969e644d428d07 to your computer and use it in GitHub Desktop.
Save yasaichi/3a57959491546500db969e644d428d07 to your computer and use it in GitHub Desktop.
Hello World in Assembly
.intel_syntax noprefix
.global main
main:
mov rdx, 14 # message length
lea rsi, [rip + message]
mov rdi, 1 # file descriptor (stdout)
mov rax, 1 # system call number (sys_write)
syscall
jmp exit
exit:
mov rdi, 0
mov rax, 60
syscall
message:
.ascii "Hello, World!\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment