Skip to content

Instantly share code, notes, and snippets.

@GitMirar
Created May 11, 2019 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GitMirar/b3dcc6e5651a2336b6a7b038ca5ee762 to your computer and use it in GitHub Desktop.
Save GitMirar/b3dcc6e5651a2336b6a7b038ca5ee762 to your computer and use it in GitHub Desktop.
gcc inline assembly intel syntax set temp to 1
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