| |
Signed Divide
86/88 |
Y |
186 |
Y |
286 |
Y |
386 |
Y |
486 |
Y |
IDIV source |
Ovfl |
? |
Dir |
N |
Int |
N |
Trap |
N |
Sign |
? |
Zero |
? |
Aux |
? |
Prty |
? |
Carry |
? |
This instruction performs signed division. If the source is a byte,
IDIV divides the word value in AX by source, returning the quotient in
AL and the remainder in AH. If the source is a word, IDIV divides the
double-word value in DX:AX by the source, returning the quotient in AX
and the remainder in DX.
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 DIV
instruction). On the 8088/8086, however, CS:IP
points to the instruction following the failed DIV
instruction.
------------------------------------ Timing ----------------------------------
OpCode Instruction 386 286 86
F6/7 IDIV AL, r/m8 19 17/20 112/118+EA
F7/7 IDIV AX, r/m16 27 25/28 184/190+EA
F7/7 IDIV EAX, r/m32 43
------------------------------------ Logic -----------------------------------
AL = AX / Source
AH = Remainder
or
AX = DX:AX / Source
DX = Remainder
See Also DIV SAR AAD CBW CWD CWDE CDQ INT/00 Flags |