title: Accessing element in array with assembly
body: <p>Assume the following function:</p>
  
  <pre><code>void asmFunction(const int *first, ...) {
      __asm {
          xor eax, eax
          add eax, [first][0]
          ; ...
      }
  }
  </code></pre>
  
  <p>It is being called this way:</p>
  
  <pre><code>int first[] =  { 0, 0, 0, 0, 0, 0, 0, 5, 7, 6, 2, 4, 3, 5 };
  asmFunction2(first, ...);
  </code></pre>
  
  <p>As far as I understand, the second assembly line must add <code>0</code> element of array <code>first</code>  to <code>eax</code>. However, a random value is being added. When debugging, <code>first[0]</code> equals 0, as it must be. What is the problem with the code?</p>
  
  <p>I code in Visual Studio 2013 on 64-bit machine.</p>