add

Add

add RT, RA, RB

Adds the contents of two registers and places the result in a third register.

Details

The add instruction adds the contents of source register RA and RB, and places the sum into target register RT. The condition register (CR0) is updated based on the result.

Pseudocode Operation

RT <- (RA) + (RB)

Programming Note

add, add., and subf are the preferred instructions...

Example

add r3, r4, r5

Encoding

Binary Layout
31
0
RT
6
RA
30
RB
31
OE
266
Rc
 
Format XO-form
Opcode 0x7C000214
Extension Base
Registers Altered CR0, XER

Operands

  • RT
    Target Register
  • RA
    Source Register 1
  • RB
    Source Register 2
  • rPX
    Destination General Purpose Register
  • rPS
    Source General Purpose Register
  • rNS
    Source General Purpose Register