oris
OR Immediate Shifted - 64 00 00 00
oris
Instruction Syntax
Mnemonic | Format | Flags |
oris | rA,rS,UIMM | None |
Instruction Encoding
0
1
1
0
0
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 | 011001 (0x19) |
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 logical OR of (rS) and the 16-bit UIMM shifted left by 16 bits is placed into rA.
Note: The oris instruction performs a logical OR operation between the source register and a 16-bit unsigned immediate value shifted left by 16 positions.
Affected Registers
General Purpose Registers (GPRs)
- rA (Destination register)
Examples
Basic OR Immediate Shifted
oris r3, r1, 0x00FF # r3 = r1 OR 0x00FF0000 oris r4, r2, 0x8000 # r4 = r2 OR 0x80000000
Upper Bit Setting
# Set upper 16 bits in r1 oris r1, r1, 0x8000 # Set bit 31 oris r1, r1, 0x4000 # Set bit 30
Address Construction
# Load upper 16 bits of address oris r3, r0, 0x8000 # r3 = 0 OR 0x80000000 ori r3, r3, 0x1234 # Add lower 16 bits # r3 now contains 0x80001234