3-293
INSTRUCTION SET REFERENCE
IDIV—Signed Divide (Continued)
ELSE
IF OpernadSize = 16 (* doubleword/word operation *)
THEN
temp
<
DX:AX / SRC; (* signed division *)
IF (temp > 7FFFH) OR (temp < 8000H)
(* if a positive result is greater than 7FFFH *)
(* or a negative result is less than 8000H *)
THEN #DE; (* divide error *) ;
ELSE
AX
<
temp;
DX
<
DX:AX SignedModulus SRC;
FI;
ELSE (* quadword/doubleword operation *)
temp
<
EDX:EAX / SRC; (* signed division *)
IF (temp > 7FFFFFFFH) OR (temp < 80000000H)
(* if a positive result is greater than 7FFFFFFFH *)
(* or a negative result is less than 80000000H *)
THEN #DE; (* divide error *) ;
ELSE
EAX
<
temp;
EDX
<
EDXE:AX SignedModulus SRC;
FI;
FI;
FI;
Flags Affected
The CF, OF, SF, ZF, AF, and PF flags are undefined.
Protected Mode Exceptions
#DE
If the source operand (divisor) is 0.
The signed result (quotient) is too large for the destination.
#GP(0)
If a memory operand effective address is outside the CS, DS, ES, FS, or
GS segment limit.
If the DS, ES, FS, or GS register is used to access memory and it contains
a null segment selector.
#SS(0)
If a memory operand effective address is outside the SS segment limit.
#PF(fault-code)If a page fault occurs.
#AC(0)
If alignment checking is enabled and an unaligned memory reference is
made while the current privilege level is 3.