Skip to content

Instantly share code, notes, and snippets.

@KarthikNayak
Last active November 21, 2023 13:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KarthikNayak/117e0c515042f3f6939c5802c2ed2b16 to your computer and use it in GitHub Desktop.
Save KarthikNayak/117e0c515042f3f6939c5802c2ed2b16 to your computer and use it in GitHub Desktop.
Hello world x64 assembly [0]
nasm -f elf64 hello.asm -o hello.o
ld -o hello hello.o -m elf_x86_64
section .data
str: db "hello, world!", 10, 0
section .data
str: db "hello, world!", 10, 0
section .text
global _start
_start:
MOV RAX, 1
MOV RDI, 1
MOV RSI, str
MOV RDX, 15
syscall
MOV RAX, 60
MOV RDI, 0
syscall
MOV RAX, 1
MOV RDI, 1
MOV RSI, str
MOV RDX, 15
syscall
asmlinkage long sys_write(unsigned int fd, const char __user *buf, size_t count);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment