Created
June 17, 2024 16:46
-
-
Save nikolaydubina/ad5ad40640afaba65cd0ed7a4e0d9cc6 to your computer and use it in GitHub Desktop.
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
// https://jameshfisher.com/2018/02/20/c-inline-assembly-hello-world/ | |
int main(void) { | |
register int syscall_no asm("rax") = 1; | |
register int arg1 asm("rdi") = 1; | |
register char* arg2 asm("rsi") = "hello, world!\n"; | |
register int arg3 asm("rdx") = 14; | |
asm("syscall"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment