Compute 2x - 1

Encoding

EncodingOperand
zoNone

Description

The F2XM1 instruction computes the value of 2 to the power of the source operand, then subtracts 1. The result is stored in the destination operand. The source and destination operands are implicitly ST(0). The value of the source operand must lie between -1 and 1; Values outside this range produce undefined results.

Operation

public void F2XM1()
{
    F80 x = FpuPop();
    x = Math.Pow(2, x) - 1;
    FpuPush(x);
}

Flags Affected

C0
Undefined.
C1
Set if the result was rounded up. Cleared otherwise or if a stack overflow occurs.
C2
Undefined.
C3
Undefined.

Exceptions

Real-Address Mode

#UD
  • If the
  • LOCK
  • prefix is used.
#NM
  • If
  • CR0.EM
  • or
  • CR0.TS
  • are
  • 1
  • .

Virtual-8086 Mode

#UD
  • If the
  • LOCK
  • prefix is used.
#NM
  • If
  • CR0.EM
  • or
  • CR0.TS
  • are
  • 1
  • .

Protected Mode

#UD
  • If the
  • LOCK
  • prefix is used.
#NM
  • If
  • CR0.EM
  • or
  • CR0.TS
  • are
  • 1
  • .

Compatibility Mode

#UD
  • If the
  • LOCK
  • prefix is used.
#NM
  • If
  • CR0.EM
  • or
  • CR0.TS
  • are
  • 1
  • .

Long Mode

#UD
  • If the
  • LOCK
  • prefix is used.
#NM
  • If
  • CR0.EM
  • or
  • CR0.TS
  • are
  • 1
  • .

Legacy Floating-Point

#MF
  • #D - Denormal operand.
  • #IA - Invalid arithmetic operation.
  • #IS - Stack overflow or underflow.
  • #P - Inexact result.
  • #U - Numeric underflow.