title: Assign 0 to variable in gcc extended assembly
body: <p>I have the following code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  void main(){
      int x=0, y=0,i=100;
      for (;i&lt;1000; i++,x+=32){
          if (x == 25*32) {
              y+=32;
              asm volatile("pushl %%eax\n\t"
                           "movl $0, %%eax\n\t"
                           "popl %%eax\n\t"
                           :"=a"(x)
                           :"a"(0)
                           );
          }
          printf("%d %d\n", x, y);
      }
  }
  </code></pre>
  
  <p>Basically, what I want to do is, set the variable x to 0 but I don't quite understand what the assembly code does, and it actually does set x to 0 but I'm not sure whats going on. can somebody explain what's going on? (just for the sake of learning assembly and C).</p>