x86 - idivl of two numbers where the first is less than the second (in assembly) -


to understanding, idivl command in c assembly takes 64-bit number represented %edx (the more significant half) , %eax (the less significant), divides argument, , stores result in %edx:%eax again.

the behavior when / b , > b expect: 10 / 2 yields 0's in %edx , 5 in %eax.

however, i'm not sure why / b when b > produces does. example, when switch 2 two / 10 (that is, %edx 0's , and %eax 2, , 'argument' that's given idivl 10), result this:

%edx has 2; %eax has 0's

why result? if mash %edx , %eax together, mean 2 / 10 = 0000000000000000000000000000001000000000000000000000000000000000 in binary 2^33 in decimal, not anywhere near 2/10.

thanks!

you're right divides edx:eax operand, doesn't store result there.
instead, puts quotient in eax , remainder in edx.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -