not.

Complement Register (Record)

not. Rx,Ry

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

Encoding

Binary Layout
31
0:5
RS
6:10
RA
11:15
RS
16:20
124
21:30
/
31
 
Format X-form
Opcode 0x7C0000F8
Extension Base

Operands

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

Example

not r3, r4

Registers Altered

CR0, XER

Related

More in Base

Reference

Description

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.

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.