Last active
November 21, 2023 13:37
-
-
Save KarthikNayak/117e0c515042f3f6939c5802c2ed2b16 to your computer and use it in GitHub Desktop.
Hello world x64 assembly [0]
This file contains 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
nasm -f elf64 hello.asm -o hello.o | |
ld -o hello hello.o -m elf_x86_64 |
This file contains 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
section .data | |
str: db "hello, world!", 10, 0 |
This file contains 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
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 |
This file contains 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
MOV RAX, 1 | |
MOV RDI, 1 | |
MOV RSI, str | |
MOV RDX, 15 | |
syscall |
This file contains 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
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