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

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

Advertisement

CBW/CWDE—Convert Byte to Word/Convert Word to Doubleword
Opcode
98
98
Description
Double the size of the source operand by means of sign extension. The CBW (convert
byte to word) instruction copies the sign (bit 7) in the source operand into every bit in
the AH register. The CWDE (convert word to doubleword) instruction copies the sign (bit
15) of the word in the AX register into the higher 16 bits of the EAX register.
The CBW and CWDE mnemonics reference the same opcode. The CBW instruction is
intended for use when the operand-size attribute is 16 and the CWDE instruction for
when the operand-size attribute is 32. Some assemblers may force the operand size to
16 when CBW is used and to 32 when CWDE is used. Others may treat these
mnemonics as synonyms (CBW/CWDE) and use the current setting of the operand-size
attribute to determine the size of values to be converted, regardless of the mnemonic
used.
The CWDE instruction is different from the CWD (convert word to double) instruction.
The CWD instruction uses the DX:AX register pair as a destination operand; whereas,
the CWDE instruction uses the EAX register as a destination.
Operation
IF OperandSize = 16 (* instruction = CBW *)
THEN AX  SignExtend(AL);
ELSE (* OperandSize = 32, instruction = CWDE *)
EAX  SignExtend(AX);
FI;
Flags Affected
None.
Additional Itanium System Environment Exceptions
Itanium Reg Faults NaT Register Consumption Abort.
Exceptions (All Operating Modes)
None.
Volume 4: Base IA-32 Instruction Reference
Instruction
CBW
CWDE
Description
AX  sign-extend of AL
EAX  sign-extend of AX
4:57

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents