
4:208
Volume 4: Base IA-32 Instruction Reference
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
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;
Содержание ITANIUM ARCHITECTURE
Страница 1: ......
Страница 7: ...402 Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Страница 199: ...4 192 Volume 4 Base IA 32 Instruction Reference FWAIT Wait See entry for WAIT ...
Страница 269: ...4 262 Volume 4 Base IA 32 Instruction Reference LES Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 270: ...Volume 4 Base IA 32 Instruction Reference 4 263 LFS Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 273: ...4 266 Volume 4 Base IA 32 Instruction Reference LGS Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 288: ...Volume 4 Base IA 32 Instruction Reference 4 281 LSS Load Full Pointer See entry for LDS LES LFS LGS LSS ...
Страница 352: ...Volume 4 Base IA 32 Instruction Reference 4 345 ROL ROR Rotate See entry for RCL RCR ROL ROR ...
Страница 368: ...Volume 4 Base IA 32 Instruction Reference 4 361 SHL SHR Shift Instructions See entry for SAL SAR SHL SHR ...
Страница 373: ...4 366 Volume 4 Base IA 32 Instruction Reference SIDT Store Interrupt Descriptor Table Register See entry for SGDT SIDT ...
Страница 589: ...4 582 Volume 4 IA 32 SSE Instruction Reference ...
Страница 590: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 Index ...
Страница 591: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Страница 603: ...INDEX Index 12 Index for Volumes 1 2 3 and 4 ...
Страница 604: ......