IDIV Integer Divide, Signed Flags: O D I T S Z A P C
? ? ? ? ? ?
IDIV source
Logic: AL AX / source ; Byte source
AH remainder
or
AX DX:AX / source ; Word source
DX remainder
IDIV performs signed division. If source is a byte, IDIV divides the
word value in AX by source, returning the quotient in AL and the
remainder in AH. If source is a word, IDIV divides the double-word
value in DX:AX by source, returning the quotient in AX and the
remainder in DX.
--------------------------------------------------------------------------
Operands Clocks Transfers Bytes Example
reg8 101-112 - 2 IDIV CL
reg16 165-184 - 2 IDIV DX
mem8 (107-118) + EA 1 2-4 IDIV BYTE[SI]
mem16 (175-194) + EA 1 2-4 IDIV [BX].WORD_ARRAY
--------------------------------------------------------------------------
Notes: If the result is too large to fit in the destination
(AL or AX), an INT 0 (Divide by Zero) is generated,
and the quotient and remainder are undefined.
The 80286 and 80386 microprocessors are able to
generate the largest negative number (80h or 8000h)
as a quotient for this instruction, but the
8088/8086 will generate an Interrupt 0 (Divide by
Zero) if this situation occurs.
When an Interrupt 0 (Divide by Zero) is generated,
the saved CS:IP value on the 80286 and 80386 points
to the instruction that failed (the IDIV
instruction). On the 8088/8086, however, CS:IP
points to the instruction following the failed IDIV
instruction.
Seealso:
This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster