Can someone please try to explain me how to add 2 32-bit numbers in 16-bit masm
nbr1 dd 1234567892
nbr2 dd 1234567892
result dd 0
mov ax, word ptr [nbr1]
add ax, word ptr [nbr2]
mov word ptr [result], ax
mov ax, word ptr [nbr1 + 2]
adc ax, word ptr [nbr2 + 2]
mov word ptr [result + 2], ax
Thanks a lot.
I am a new user of MASM and I'm not really good at this more complicated things.
Now I have general idea how to solve this problem but still I don't get it.
Can you please explain me what does this mean in few steps and is it possible to print result of adding 2 32-bit numbers.
First it adds the last two words then adds the first two ones with the carry bit retrieved from the first addition (this bit is set if the result of the addition if greater than 0ffffh).
To print the result variable you need to convert it into ascii, and before you ask how to do this i suggest to use google or browse this forum to find the answer.