title: Nasm - move value from a 4 byte register into an 1 byte address space
body: <p>How does nasm behave when I move the 4 byte value stored in eax, ebx, ecx etc. to an address space that has less than 4 bytes of space allocated? Respectively how does nasm behave when I move a 1 byte value stored in <code>var</code> to an 4 byte register?</p>
  
  <p>Like:</p>
  
  <pre><code>.bss
  var resb 1
  .text
  mov eax, 2000000000
  mov [var], eax
  
  xor ebx, ebx
  mov ebx, [var]
  </code></pre>
  
  <p>What values would <code>[var]</code> and <code>ebx</code> have? And why? When calling <code>printf</code> with <code>%d</code> I get <code>2000000000</code> as a result. But how can this be? <code>var</code> can only save 1 byte. How is it possible that a number that requires a larger amount of bytes can be received from it?  </p>