addze

Add to Zero Extended

addze RT, RA

Adds a register, 0, and the Carry bit.

Details

Adds the value in RA, zero, and the Carry bit (XER[CA]), storing the result in RT. This instruction is commonly used to propagate a carry or decrement by one when combined with other arithmetic operations. Condition register CR0 is updated if Rc=1; overflow is recorded in XER[OV] if OE=1.

Pseudocode Operation

RT ← RA + 0 + XER[CA]
if OE = 1 then
  (OV, CA) ← overflow and carry results
if Rc = 1 then
  CR0 ← (RT == 0, RT < 0, RT > 0, XER[SO])

Programming Note

When Rc=1 (dot form), CR0 is updated with the signed comparison of the result against zero (LT, GT, EQ) and the current SO bit from XER.

Example

addze r3, r4

// r3 = r4 + CA

Encoding

Binary Layout
31
0
RT
6
RA
11
00000
16
OE
21
202
22
Rc
31
 
Format XO-form
Opcode 0x7C000194
Extension Base
Registers Altered CR0

Operands

  • RT
    Target Register
  • RA
    Source Register