Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"idiv"ing double words
#1
I'm stuck Sad

Awhile back I asked if there was a way to divide dx:ax by bx and get a double word anwer. (like FFFFFFFFh / Ah = 19999999h) and I got this peice of code.....

Code:
;*dx:ax/bx; dx:ax = answer, cx = remainder*
push ax            ;save ax (lower word)
mov ax,dx        ;higher word into ax so it can be divided
xor dx,dx        ;dx = 0
div bx            ;dx:ax/bx; ax = answer dx = remainder
mov cx,ax        ;save higher word
pop ax            ;get ax, the lower word
div bx            ;dx:ax/bx again
xchg dx,cx        ;extange;dx = higher word cx = remainder

I was wondering if anyone knew how to do the same thing with the "idiv" (divide with sign) function. Thanks.
Reply


Messages In This Thread
"idiv"ing double words - by rCX - 07-28-2004, 11:45 PM
"idiv"ing double words - by DrV - 07-29-2004, 05:29 PM
"idiv"ing double words - by rCX - 07-31-2004, 02:22 AM
"idiv"ing double words - by relsoft - 08-01-2004, 11:30 AM
"idiv"ing double words - by rCX - 08-02-2004, 04:12 AM
"idiv"ing double words - by Plasma - 08-02-2004, 05:44 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)