title: Why is this inline assembly not working with a separate asm volatile statement for each instruction?
body: <p>For the the following code:</p>
  
  <pre><code>long buf[64];
  
  register long rrax asm ("rax");
  register long rrbx asm ("rbx");
  register long rrsi asm ("rsi");
  
  rrax = 0x34;
  rrbx = 0x39;
  
  __asm__ __volatile__ ("movq $buf,%rsi");
  __asm__ __volatile__ ("movq %rax, 0(%rsi);");
  __asm__ __volatile__ ("movq %rbx, 8(%rsi);");
  
  printf( "buf[0] = %lx, buf[1] = %lx!\n", buf[0], buf[1] );
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>buf[0] = 0, buf[1] = 346161cbc0!
  </code></pre>
  
  <p>while it should have been:</p>
  
  <pre><code>buf[0] = 34, buf[1] = 39!
  </code></pre>
  
  <p>Any ideas why it is not working properly, and how to solve it?</p>