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

Assembler Language Reference

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 effects 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

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.

Related Information

Fixed-Point Processor .

Fixed-Point Arithmetic Instructions .

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