[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Assembler Language Reference

subfic or sfi (Subtract from Immediate Carrying) Instruction

Purpose

Subtracts the contents of a general-purpose register from a 16-bit signed integer and places the result in another general-purpose register.

Syntax

Bits Value
0-5 08
6-10 RT
11-15 RA
16-31 SI
PowerPC 
subfic RT, RA, SI
POWER family 
sfi RT, RA, SI

Description

The subfic and sfi instructions add the one's complement of the contents of general-purpose register (GPR) RA, 1, and a 16-bit signed integer SI. The result is placed in the target GPR RT.

Note: When SI is -1, the subfic and sfi instructions place the one's complement of the contents of GPR RA in GPR RT.

The subfic and sfi instructions have one syntax form and do not affect Condition Register Field 0. These instructions always affect the Carry bit in the Fixed-Point Exception Register.

Parameters

RT Specifies target general-purpose register where result of operation is stored.
RA Specifies source general-purpose register for operation.
SI Specifies 16-bit signed integer for operation.

Examples

The following code subtracts the contents of GPR 4 from the signed integer 0x0000 7000 and stores the result in GPR 6:

# Assume GPR 4 holds 0x9000 3000.
subfic 6,4,0x00007000
# GPR 6 now holds 0x7000 4000.

Related Information

Fixed-Point Processor .

Fixed-Point Arithmetic Instructions .

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]