| Opcode | Encoding | 16-bit | 32-bit | 64-bit | Description |
|---|---|---|---|---|---|
98CBW | zo | Valid | Valid | Valid | Sign extend AL into AX. |
98CWDE | zo | Valid | Valid | Valid | Sign extend AX into EAX. |
REX.W 98CDQE | zo | N/E | N/E | Valid | Sign extend EAX into RAX. |
Encoding
| Encoding | Operand |
|---|---|
zo | None |
Description
The CBW/CWDE/CDQE instructions sign extend the accumulator to the next larger size.
This instruction is similar to CWD-CDQ-CQO (Sign Extend Accumulator Into rDX), but working only with the accumulator.
Operation
public void CBW()
{
AX = SignExtend(AL);
}
public void CWDE()
{
EAX = SignExtend(AX);
}
public void CDQE()
{
RAX = SignExtend(EAX);
}Flags Affected
None.Exceptions
Real-Address Mode
#UD- If the
LOCK- prefix is used.
Virtual-8086 Mode
#UD- If the
LOCK- prefix is used.
Protected Mode
#UD- If the
LOCK- prefix is used.
Compatibility Mode
#UD- If the
LOCK- prefix is used.
Long Mode
#UD- If the
LOCK- prefix is used.