Last active
October 17, 2021 02:26
-
-
Save lzpel/55216b0d56232b343cc2cab77045d764 to your computer and use it in GitHub Desktop.
x64 linux only. `gcc helloworld_in_extended_asm.c ; ./a.out`
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
int main(void){ | |
const char mes[] = "hello, world\n\0"; | |
asm volatile( | |
"movq %0, %%rsi \n\t movq %1, %%rdx \n\t movq $1, %%rax \n\t movq $1, %%rdi \n\t syscall" | |
: | |
:"r"(mes),"r"(sizeof(mes)) | |
: | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment