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.
| 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.
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.
| 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. |
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.
Fixed-Point Arithmetic Instructions .