title: Visual-C++ inline assembler compiled incorrectly
body: <p>Recently I've asked the Community about difference of two offsets <a href="https://stackoverflow.com/questions/13420744/visual-c-inline-assembler-difference-of-two-offsets">Visual-C++ inline assembler difference of two offsets</a> and got reply quickly, thanks a lot.
  Now I've came into other problem, which is worse.</p>
  
  <p>I have an instruction like</p>
  
  <pre><code>    ..naked...
      __asm{
      ...
      mov eax, dword ptr [ebx + offset data1]
      ...
      }
  </code></pre>
  
  <p>The real problem is that it gets compiled as</p>
  
  <pre><code>    mov eax, [offset data1]
  </code></pre>
  
  <p>No compiler warnings (/WAll mode) on this line, but code is changed and changed a lot - imagine, it got thrown ebx + part at all! Silently.
  Is it a compiler bug or a feature? Maybe I have to specify some additional flag?</p>
  
  <p>Problem is with offset only, since</p>
  
  <pre><code>    mov eax, dword ptr [ebx + 0xconst]
  </code></pre>
  
  <p>is compiled correctly.</p>
  
  <p>Yes, I can get around with code</p>
  
  <pre><code>    mov eax, offset data1
      add eax, ebx
      mov eax, [eax]
  </code></pre>
  
  <p>But there's a lot of code to be changed then. What bothers me is absence of any warnings;</p>