I have a program that multiplies 3 numbers and i am trying to understand. I have some questions and i am hoping someone can explain whats going on with the program and tell me if i am on the right track. I understand i have more than one question so i am sorry about that.
.data?
num1 dd ?
num2 dd ?
num3 dd ?
.data
sum dd 0
prod dd 0
.code
start:
main proc
mov EAX, sval(input("Enter a number: "))
mov num1, EAX
mov EAX, sval(input("Enter a number: "))
mov num2, EAX
mov EAX, sval(input("Enter a number: "))
mov num3, EAX
mov EAX, num1
mov EBX, num2
mul BL
mov EBX, num3
mul BX
mov prod, EDX
this has me confused...
mov EBX, num3
mul BX
so, we are storing num3 into BL? but since the result of num1 and num2 is 16 bit and stored into AX we mul BX? instead of BL? but isnt num3 in BL?
im sorry there isnt one specific question. If my logic is incorrect or close can you explain whats going on piece by piece and why?
Thank you
IMUL
? – Homoousian