tags:

views:

44

answers:

1

I am using a run-time debugger.

EAX: 0000 0023 EDX: 5555 5556

imul edx

EAX: aaaa aac2 EDX: 0000 000b

I am utterly confused, and can't figure out how this multiply is working. What's happening here? I notice in a similar question here that imul ebx ; result in EDX:EAX I don't understand the EDX:EAX notation though :/

+5  A: 

When imul is passed a 32 bit argument as in your case with EDX which effectively means EAX * EDX where both EAX and EDX are 32 bit registers.

Since you are multiplying two 32 bit values it is possible that the answer will overflow 32 bits in which case the high 32 bits of the answer will be written to the EDX register and the low 32 bits to the EAX register, this is represented with the `EDX:EAX' notation.

Chris Taylor