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

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

Advertisement

IMUL—Signed Multiply (Continued)
The three forms of the IMUL instruction are similar in that the length of the product is
calculated to twice the length of the operands. With the one-operand form, the product
is stored exactly in the destination. With the two- and three- operand forms, however,
result is truncated to the length of the destination before it is stored in the destination
register. Because of this truncation, the CF or OF flag should be tested to ensure that no
significant bits are lost.
The two- and three-operand forms may also be used with unsigned operands because
the lower half of the product is the same regardless if the operands are signed or
unsigned. The CF and OF flags, however, cannot be used to determine if the upper half
of the result is non-zero.
Operation
IF (NumberOfOperands = 1)
THEN IF (OperandSize = 8)
THEN
ELSE IF OperandSize = 16
FI;
ELSE IF (NumberOfOperands = 2)
THEN
ELSE (* NumberOfOperands = 3 *)
FI;
FI;
4:208
AX  AL  SRC (* signed multiplication *)
IF ((AH = 00H) OR (AH = FFH))
THEN CF = 0; OF = 0;
ELSE CF = 1; OF = 1;
FI;
THEN
DX:AX  AX  SRC (* signed multiplication *)
IF ((DX = 0000H) OR (DX = FFFFH))
THEN CF = 0; OF = 0;
ELSE CF = 1; OF = 1;
FI;
ELSE (* OperandSize = 32 *)
EDX:EAX  EAX  SRC (* signed multiplication *)
IF ((EDX = 00000000H) OR (EDX = FFFFFFFFH))
THEN CF = 0; OF = 0;
ELSE CF = 1; OF = 1;
FI;
temp  DEST  SRC
(* signed multiplication; temp is double DEST size*)
DEST  DEST  SRC (* signed multiplication *)
IF temp  DEST
THEN CF = 1; OF = 1;
ELSE CF = 0; OF = 0;
FI;
DEST  SRC1  SRC2 (* signed multiplication *)
temp SRC1 SRC2
IF temp  DEST
THEN CF = 1; OF = 1;
ELSE CF = 0; OF = 0;
FI;
(* signed multiplication; temp is double SRC1 size *)
Volume 4: Base IA-32 Instruction Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents