title: Weird results with movzwl, %ax and negative values
body: <p>Alright, so I am dealing with the following snippet of code:</p>
  
  <pre><code>push   %ebp
  mov    %esp,%ebp   
  push   %ebx
  mov    0x8(%ebp),%eax 
  movzwl %ax,%edx
  </code></pre>
  
  <p>So this behaves as expected when dealing with positive values. The value copied into %edx is the trailing 16 bits of %eax (or %ax).</p>
  
  <p>However, if you put a negative number in, everything starts getting weird and it does not seem to be behaving as expected. </p>
  
  <p>For example, if the value of %eax is -67043552, then the value copied into %edx is 65312.</p>
  
  <p>I'm fairly new to assembly, sorry if this is an obvious misinterpretation on my part. Any help would be greatly appreciated. </p>