addic or ai (Add Immediate Carrying) instruction

Purpose

Adds the contents of a general-purpose register and a 16-bit signed integer, places the result in a general-purpose register, and affects the Carry bit of the Fixed-Point Exception Register.

Syntax

Bits Value
0 - 5 12
6 - 10 RT
11 - 15 RA
16 - 31 SI
PowerPC® 
addic RT, RA, SI
POWER® family 
ai RT, RA, SI

See Extended Mnemonics of Fixed-Point Arithmetic Instructions for more information.

Description

The addic and ai instructions place the sum of the contents of general-purpose register (GPR) RA and a 16-bit signed integer, SI, into target GPR RT.

The 16-bit integer provided as immediate data is sign-extended to 32 bits prior to carrying out the addition operation.

The addic and ai instructions have one syntax form and can set the Carry bit of the Fixed-Point Exception Register; these instructions never affect Condition Register Field 0.

Parameters

Item Description
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 adds 0xFFFF FFFF to the contents of GPR 4, stores the result in GPR 6, and sets the Carry bit to reflect the result of the operation:


# Assume GPR 4 contains 0x0000 2346.
addic 6,4,0xFFFFFFFF
# GPR 6 now contains 0x0000 2345.