3-149
INSTRUCTION SET REFERENCE
DIV—Unsigned Divide (Continued)
Operation
IF SRC = 0
THEN #DE; (* divide error *)
FI;
IF OpernadSize = 8 (* word/byte operation *)
THEN
temp
<
AX / SRC;
IF temp > FFH
THEN #DE; (* divide error *) ;
ELSE
AL
<
temp;
AH
<
AX MOD SRC;
FI;
ELSE
IF OperandSize = 16 (* doubleword/word operation *)
THEN
temp
<
DX:AX / SRC;
IF temp > FFFFH
THEN #DE; (* divide error *) ;
ELSE
AX
<
temp;
DX
<
DX:AX MOD SRC;
FI;
ELSE (* quadword/doubleword operation *)
temp
<
EDX:EAX / SRC;
IF temp > FFFFFFFFH
THEN #DE; (* divide error *) ;
ELSE
EAX
<
temp;
EDX
<
EDX:EAX MOD SRC;
FI;
FI;
FI;
Flags Affected
The CF, OF, SF, ZF, AF, and PF flags are undefined.