IDIV Integer Divide, Signed Flags: O D I T S Z A P C

Logic: AL AX / source ; Byte source

AX DX:AX / source ; Word source

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

Operands Clocks Transfers Bytes Example

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