[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Assembler Language Reference

fabs (Floating Absolute Value) Instruction

Purpose

Stores the absolute value of the contents of a floating-point register in another floating-point register.

Syntax

fabs FRT,FRB
fabs. FRT,FRB

Description

The fabs instruction sets bit 0 of floating-point register (FPR) FRB to 0 and places the result into FPR FRT.

The fabs instruction has two syntax forms. Each syntax form has a different effect on Condition Register Field 1.

Syntax Form Floating-Point Status and Control Register Record Bit (Rc) Condition Register Field 1
fabs None 0 None
fabs. None 1 FX,FEX,VX,OX

The two syntax forms of the fabs instruction never affect the Floating-Point Status and Control Register. If the syntax form sets the Record (Rc) bit to 1, the instruction affects the Floating-Point Exception Summary (FX), Floating-Point Enabled Exception Summary (FEX), Floating-Point Invalid Operation Exception Summary (VX), and Floating-Point Overflow Exception (OX) bits in Condition Register Field 1.

Parameters

FRT Specifies target floating-point register for operation.
FRB Specifies source floating-point register for operation.

Examples

  1. The following code sets bit 0 of FPR 4 to zero and place sthe result in FPR 6:
    # Assume FPR 4 holds 0xC053 4000 0000 0000.
    fabs 6,4
    # GPR 6 now holds 0x4053 4000 0000 0000.
  2. The following code sets bit 0 of FPR 25 to zero, places the result in FPR 6, and sets Condition Register Field 1 to reflect the result of the operation:
    # Assume FPR 25 holds 0xFFFF FFFF FFFF FFFF.
    fabs. 6,25
    # GPR 6 now holds 0x7FFF FFFF FFFF FFFF.

Related Information

Floating-Point Processor .

Floating-Point Move Instructions .

Interpreting the Contents of a Floating-Point Register .


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]