xoris
Exclusive OR Immediate Shifted - 6C 00 00 00
xoris

Instruction Syntax

Mnemonic Format Flags
xoris rA,rS,UIMM None

Instruction Encoding

0
1
1
0
1
1
S
S
S
S
S
A
A
A
A
A
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I
I

Field Bits Description
Primary Opcode 0-5 011011 (0x1B)
rS 6-10 Source register
rA 11-15 Destination register
UIMM 16-31 Unsigned immediate value (shifted left by 16)

Operation

rA ← (rS) ⊕ (UIMM << 16)

The exclusive OR of the value in register rS and the unsigned immediate value shifted left by 16 bits is placed into register rA.

Note: The xoris instruction performs bitwise exclusive OR operation with an immediate value that is shifted left by 16 bits.

Affected Registers

General Purpose Registers (GPRs)

Examples

Basic Exclusive OR Immediate Shifted

xoris r3, r1, 0xFF   # r3 = r1 ⊕ (0xFF << 16)

Bit Manipulation

# Toggle high-order bits
xoris r3, r3, 0x80   # Toggle bit 23 in r3 (0x80 << 16 = 0x800000)

High-Order Bit Operations

# Set high-order bits
xoris r3, r0, 0xFFFF # r3 = 0 ⊕ 0xFFFF0000 = 0xFFFF0000

Related Instructions

xor, xori, oris, andis

Back to Index