oris

OR Immediate Shifted

oris RA, RS, UI

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

Details

Performs a bitwise OR between a general-purpose register and a 16-bit unsigned immediate value shifted left by 16 bits, storing the result in another register. This is a base category instruction used to set high-order bits with no condition register updates.

Pseudocode Operation

RA ← RS | (UI || 0x0000)

Programming Note

The oris instruction is commonly used to set specific bits in a register by ORing it with an immediate value. Be cautious of overflow if UI exceeds the upper limit, as it will be truncated. This instruction operates at user privilege level and does not generate exceptions under normal circumstances.

Example

oris r3, r4, 0xFFFF

// Set upper 16 bits.

Encoding

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

Operands

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