Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual page 1506

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

IDIV—Signed Divide
Opcode
F6 /7
F7 /7
F7 /7
Description
Divides (signed) the value in the AL, AX, or EAX register by the source operand and
stores the result in the AX, 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:
Table 2-13.
Operand Size
Word/byte
Doubleword/word
Quadword/doubleword
Non-integral results are truncated (chopped) towards 0. The sign of the remainder is
always the same as the sign of the dividend. The absolute value of the remainder is
always less than the absolute value of the divisor. Overflow is indicated with the #DE
(divide error) exception rather than with the OF flag.
Operation
IF SRC = 0
THEN #DE; (* divide error *)
FI;
IF OpernadSize = 8 (* word/byte operation *)
THEN
temp  AX / SRC; (* signed division *)
IF (temp > 7FH) OR (temp < 80H)
(* if a positive result is greater than 7FH or a negative result is less than 80H *)
FI;
ELSE
IF OpernadSize = 16 (* doubleword/word operation *)
4:204
Instruction
IDIV r/m8
IDIV r/m16
IDIV r/m32
IDIV Operands
Dividend
AX
DX:AX
EDX:EAX
THEN #DE; (* divide error *) ;
ELSE
AL  temp;
AH  AX SignedModulus SRC;
THEN
Description
Signed divide AX (where AH must contain sign-extension of
AL) by r/m byte. (Results: AL=Quotient, AH=Remainder)
Signed divide DX:AX (where DX must contain sign-extension
of AX) by r/m word. (Results: AX=Quotient, DX=Remainder)
Signed divide EDX:EAX (where EDX must contain
sign-extension of EAX) by r/m doubleword. (Results:
EAX=Quotient, EDX=Remainder)
Divisor
Quotient
Remainder
r/m8
AL
AH
r/m16
AX
DX
r/m32
EAX
EDX
Volume 4: Base IA-32 Instruction Reference
Quotient
Range
 128 to +127
 32,768 to +32,767
 2
31
32
 1
to 2

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents