andc

AND with Complement

andc RA, RS, RB

Performs a bitwise AND between RS and the one's complement of RB.

Details

The AND with Complement instruction (andc) performs a bitwise AND operation between the contents of registers RS and RB, then complements the result. The complemented result is placed into register RA.

Pseudocode Operation

RA <- (RS) & ~(RB)

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

andc r3, r4, r5

Encoding

Binary Layout
31
0
RS
6
RA
11
RB
16
60
21
Rc
31
 
Format X-form
Opcode 0x7C000078
Extension Base
Registers Altered CR0

Operands

  • RA
    Target Register
  • RS
    Source Register 1
  • RB
    Source Register 2