title: What value is in EAX after execution of each instruction?
body: <p>I am trying to track the EAX register through each snippet of the code in a MASM32 program. I need help with explaining why it is the value it is. This is what I have:</p>
  
  <pre><code>.DATA
   alfa BYTE 96h
  
  .CODE
   start:
  
   MOV EAX,0  ; move 0 to eax 
   MOV AL,alfa ; move 96h to AL, this says the value of eax is now positive 150
   MOVZX EAX,alfa ; still says EAX is 96h and value is  positive 150
   MOVSX EAX,alfa  ; says value is negative 106 and eax register is FFFFFF96
  
   call DumpRegs
   call WriteInt
  exit
  END start
  </code></pre>
  
  <p>I am using <code>DumpRegs</code> to display the registers and <code>WriteInt</code> to print the value of EAX. I have some questions:</p>
  
  <ol>
  <li>When <code>MOV AL, alfa</code>, it moves <code>alfa</code> into the EAX register, isn't AL an 8-bit register? why does it do this? Why does <code>WriteInt</code> say that the value is +150?</li>
  <li>What do <code>MOVZX</code> and <code>MOVSX</code> do? </li>
  <li>What does <code>MOVZX EAX, alfa</code> do? None of the values had changed?</li>
  <li><code>MOVSX EAX, alfa</code>, why is it -106 and the EAX register FFFFFF96? Is it because it is negative?</li>
  </ol>