Floating-Point Absolute Value

Encoding

EncodingOperand
zoNone

Description

The FABS instruction computes the absolute value of the source operand. The result is stored in the destination operand. The source and destination operands are implicitly ST(0).

Operation

public void FABS()
{
    F80 x = FpuPop();
    x.Sign = 0;
    FpuPush(x);
}

Flags Affected

C0
Undefined.
C1
Cleared.
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
  • #IS - Stack overflow or underflow.