![Intel ITANIUM ARCHITECTURE Manual Download Page 92](http://html.mh-extra.com/html/intel/itanium-architecture/itanium-architecture_manual_2073403092.webp)
Volume 4: Base IA-32 Instruction Reference
4:85
CWD/CDQ—Convert Word to Doubleword/Convert Doubleword to
Quadword
Description
Doubles the size of the operand in register AX or EAX (depending on the operand size)
by means of sign extension and stores the result in registers DX:AX or EDX:EAX,
respectively. The CWD instruction copies the sign (bit 15) of the value in the AX register
into every bit position in the DX register. The CDQ instruction copies the sign (bit 31) of
the value in the EAX register into every bit position in the EDX register.
The CWD instruction can be used to produce a doubleword dividend from a word before
a word division, and the CDQ instruction can be used to produce a quadword dividend
from a doubleword before doubleword division.
The CWD and CDQ mnemonics reference the same opcode. The CWD instruction is
intended for use when the operand-size attribute is 16 and the CDQ instruction for
when the operand-size attribute is 32. Some assemblers may force the operand size to
16 when CWD is used and to 32 when CDQ is used. Others may treat these mnemonics
as synonyms (CWD/CDQ) and use the current setting of the operand-size attribute to
determine the size of values to be converted, regardless of the mnemonic used.
Operation
IF OperandSize = 16 (* CWD instruction *)
THEN DX
SignExtend(AX);
ELSE (* OperandSize = 32, CDQ instruction *)
EDX
SignExtend(EAX);
FI;
Additional Itanium System Environment Exceptions
Itanium Reg Faults NaT Register Consumption Abort.
Flags Affected
None.
Exceptions (All Operating Modes)
None.
Opcode
Instruction
Description
99
CWD
DX:AX
sign-extend of AX
99
CDQ
EDX:EAX
sign-extend of EAX
Summary of Contents for ITANIUM ARCHITECTURE
Page 1: ......
Page 7: ...402 Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 199: ...4 192 Volume 4 Base IA 32 Instruction Reference FWAIT Wait See entry for WAIT ...
Page 352: ...Volume 4 Base IA 32 Instruction Reference 4 345 ROL ROR Rotate See entry for RCL RCR ROL ROR ...
Page 589: ...4 582 Volume 4 IA 32 SSE Instruction Reference ...
Page 590: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 Index ...
Page 591: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 603: ...INDEX Index 12 Index for Volumes 1 2 3 and 4 ...
Page 604: ......