Sign Extend Accumulator

Encoding

EncodingOperand
zoNone

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.