News:

We've upgraded the forum software.
You may need to log in again or reset your password!

Main Menu

Little Assembly Question

Started by Brazilian Fan, May 01, 2007, 07:37:10 PM

Brazilian Fan

I have a little question regarding x86 assembly:

On any 386 instruction set reference, the description about DIV (Unsigned Divide) are as follows:

"... DIV divides the EDX:EAX with r/m32 and stores the result on the EAX register, and the remainder on the EDX register..."

But I don't understand the 'EDX:EAX' part, what it means?

Thanks in advance  (thumbsup)

zanco

Take it to the Homework Forum :P Just kidding.
if anyone finds and communicate to us that which thus far has eluded our efforts, great will be our gratitude.
          Jakob Bernouilli

"Zanco`, n00b o' The Flares"

BlackBox

#2
EDX:EAX makes up a 64bit pair (it is the dividend).

the EDX:EAX notation means that EDX is the high 32 bits and EAX is the low 32 bits. Besides that, you treat it as a 64bit number when put together. This is the case when the divisor (the argument to DIV) is 32 bits. (You can only do a 64/32 division like this on the 386 and later, if you happen to be coding for some older platform)

Do also keep in mind that DIV treats the numbers as unsigned. If you need signed division use IDIV. (it works the same way)

Brazilian Fan