3-148
INSTRUCTION SET REFERENCE
DIV—Unsigned Divide
Description
This instruction divides (unsigned) the value in the AX register, DX:AX register pair, or
EDX:EAX register pair (dividend) by the source operand (divisor) and stores the result in the
AX (AH:AL), DX:AX, or EDX:EAX registers. The source operand can be a general-purpose
register or a memory location. The action of this instruction depends on the operand size, as
shown in the following table:
Non-integral results are truncated (chopped) towards 0. The remainder is always less than the
divisor in magnitude. Overflow is indicated with the #DE (divide error) exception rather than
with the CF flag.
Opcode
Instruction
Description
F6 /6
DIV r/m8
Unsigned divide AX by r/m8; AL
<
Quotient,
AH
<
Remainder
F7 /6
DIV r/m16
Unsigned divide DX:AX by r/m16; AX
<
Quotient,
DX
<
Remainder
F7 /6
DIV r/m32
Unsigned divide EDX:EAX by r/m32 doubleword;
EAX
<
Quotient, EDX
<
Remainder
Operand Size
DividendDivisorQuotientRemainder
Maximum
Quotient
Word/byte
AX
r/m8AL
AH
255
Doubleword/word
DX:AXr/m16AX
DX
65,535
Quadword/doublewordEDX:EAXr/m32EAX
EDX
2
32
?
1