title: Assembly language - masm32 - multiplying
body: <p>I am multiplying 3 numbers which works good even with a carry. I want to add a 4th number to multiply just for learning purposes.</p>
  
  <p>After i multiply 3 numbers i shift into EDX and print. Works great.
  After i add a 4th number i think i am multiplying 32bit x 32bit? So it stores into EDX:EAX?</p>
  
  <p>Would i then need to shift EAX into EDX so they are together to print?
  Im not sure if i am doing it right for the 4th number?</p>
  
  <pre><code>.data?
    num1 dd ?
    num2 dd ?
    num3 dd ?
    num4 dd ?
  
  .data
  sum dd 0
  prod dd 0
  prod2 dd 0
  </code></pre>
  
  <p>here are the prompts</p>
  
  <pre><code>mov EAX, sval(input("Enter first number: "))
  mov num1, EAX
  mov EAX, sval(input("Enter second number: "))
  mov num2, EAX
  mov EAX, sval(input("Enter third number: "))
  mov num3, EAX
  
  mov EAX, sval(input("Enter fourth number: "))
  mov num4, EAX
  </code></pre>
  
  <p>here is the logic</p>
  
  <pre><code>mov EAX, num1
  mov EBX, num2
  mul BL                 ; 8 bit x 8 bit ----&gt; AX / 16bit
  
  mov EBX, num3
  mul BX     ; 16bit x 16bit ---&gt;DX:AX
  
  shl EDX, 16  ; shift low to high             ;high / low in EDX
  mov DX, AX     ; mov in all reg
  
  mov ECX, num4   ; 32bit x 32bit ---&gt; EDX:EAX
  mul CX
  mov prod2, EAX  ; for printing
  </code></pre>
  
  <p>I am not sure if i should move num4 into ECX and multiplying by CX
  Should i be multiplying by 32bit instead? What am i doing wrong for the 4th number?
  Thank you</p>