title: bits 16 and bits 32 in nasm
body: <p>test.asm:</p>
  
  <pre><code>org 0100h
  [BITS 16]
  mov eax, 0
  [BITS 32]
  mov eax, 0
  </code></pre>
  
  <p>Then compile and disassemble as follows:</p>
  
  <p><code>nasm test.asm -o test.com</code></p>
  
  <p><code>ndisasm -o 0x0100 test.com</code></p>
  
  <p>Result: </p>
  
  <pre><code>00000100  66B800000000      mov eax,0x0
  00000106  B80000            mov ax,0x0
  00000109  0000              add [bx+si],al
  </code></pre>
  
  <p>So from the result, we can see that <code>[BITS 16]</code> use <code>eax</code>, <code>[BITS 32]</code> use <code>ax</code>, why? Should the result turn over?</p>