3-297
INSTRUCTION SET REFERENCE
IMUL—Signed Multiply (Continued)
Operation
IF (NumberOfOperands = 1)
THEN IF (OperandSize = 8)
THEN
AX
<
AL
?
SRC (* signed multiplication *)
IF ((AH = 00H) OR (AH = FFH))
THEN CF = 0; OF = 0;
ELSE CF = 1; OF = 1;
FI;
ELSE IF OperandSize = 16
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;
FI;
ELSE IF (NumberOfOperands = 2)
THEN
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;
ELSE (* NumberOfOperands = 3 *)
DEST
<
SRC1
?
SRC2 (* signed multiplication *)
temp
<
SRC1
?
SRC2 (* signed multiplication; temp is double SRC1 size *)
IF temp
?
DEST
THEN CF = 1; OF = 1;
ELSE CF = 0; OF = 0;
FI;
FI;
FI;