Created
May 11, 2019 09:06
-
-
Save GitMirar/b3dcc6e5651a2336b6a7b038ca5ee762 to your computer and use it in GitHub Desktop.
gcc inline assembly intel syntax set temp to 1
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(int argc, char* argv[]) { | |
int temp; | |
temp = 42; | |
__asm__ __volatile__ ( | |
".intel_syntax;" | |
"mov %%eax, %1;" | |
"mov %0, %%eax;" | |
".att_syntax;" | |
: "=r"(temp) | |
: "r"(1) | |
: "rax"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment