title: How to set a variable in GCC with Intel syntax inline assembly?
body: <p>Why doesn't this code set <code>temp</code> to 1? How do I actually do that?</p>
  
  <pre><code>int temp;
  __asm__(
      ".intel_syntax;"
      "mov %0, eax;"
      "mov eax, %1;"
      ".att_syntax;"
      : : "r"(1), "r"(temp) : "eax");
  printf("%d\n", temp);
  </code></pre>