title: Putting two numbers into the EAX register
body: <p>Im trying to multiply two 16 bit numbers with the following NASM codes:</p>
  
  <pre><code>mov ax, [input1]
  mov bx, [input2]
  mul bx
  </code></pre>
  
  <p>The result of the previous codes is stored in DX:AX</p>
  
  <p>Im trying to print the integer to the screen using a function from a separate library "print_int". But print_int requires that the integer must be in the EAX register.</p>
  
  <p>How can i put the 32-bit integer in the EAX register?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I came up with this</p>
  
  <pre><code>mov cx, dx  ;move upper half(16 bits) of result in cx
  shl ecx, 16 ;shift the contents of ecx 16 bits to the left
  mov cx, ax  ;move lower half(16 bits) of result in cx
  </code></pre>