not

Complement Register

not Rx,Ry
not. Rx,Ry

Complements the contents of one register and places the result into another register.

Details

The 'not' instruction complements the contents of register Ry and places the result into register Rx. This mnemonic can be coded with a final '.' to cause the Rc bit to be set in the underlying instruction.

Pseudocode Operation

if 'not' then
    Rx <- ~Ry
if 'not.' then
    Rx <- ~Ry
    Rc = 1

Programming Note

The 'not' instruction is commonly used for bitwise negation of a register's contents. Be cautious with the '.' suffix as it affects the condition register (CR0) by setting the Rc bit, which can impact subsequent conditional branches. Ensure that the registers are properly aligned and accessible at the privilege level required for execution.

Example

not r3, r4

Encoding

Binary Layout
31
0
RS
6
RA
30
RS
31
124
/
 
Format X-form
Opcode 0x7C0000F8
Extension Base
Registers Altered CR0, XER

Operands

  • RA
    Target
  • RS
    Source
  • Rx
    Target General Purpose Register
  • Ry
    Source General Purpose Register