Skip to content

Instantly share code, notes, and snippets.

@nikolaydubina
Created June 17, 2024 16:46
Show Gist options
  • Save nikolaydubina/ad5ad40640afaba65cd0ed7a4e0d9cc6 to your computer and use it in GitHub Desktop.
Save nikolaydubina/ad5ad40640afaba65cd0ed7a4e0d9cc6 to your computer and use it in GitHub Desktop.
// 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