xoris

XOR Immediate Shifted

xoris RA, RS, UI

Performs a bitwise XOR with a 16-bit immediate shifted left by 16 bits.

Details

XOR Immediate Shifted performs a bitwise XOR between the contents of GPR RS and a 16-bit unsigned immediate shifted left by 16 bits, storing the result in GPR RA. This is a Base category instruction that does not affect condition registers or status fields.

Pseudocode Operation

RA ← RS XOR (UI || 0x0000)

Programming Note

The xoris instruction is useful for performing bitwise operations with a large immediate value. Be cautious of overflow if the immediate value exceeds 16 bits, as only the lower 16 bits are considered. This instruction operates at user privilege level and does not generate exceptions under normal circumstances.

Example

xoris r3, r4, 0xFFFF

// Toggle upper 16 bits.

Encoding

Binary Layout
27
0
RS
6
RA
11
UI
16
 
Format D-form
Opcode 0x6C000000
Extension Base

Operands

  • RA
    Target Register
  • RS
    Source Register
  • UI
    Unsigned 16-bit Immediate