ori
Bitwise OR immediate
Sets the first register to the bitwise OR of the second and an immediate, with the immediate zero-extended instead of sign-extended.
Used in
- Arithmetic, logic and bitsMIPS assembly
Forms
ori , ,
Pseudo-instructions
The processor does not have these forms. The assembler replaces each of them with one or more real instructions. Open a row to see them.
-
Set $t1 to ($t2 bitwise-OR 32-bit immediate)
-
Set $t1 to $t2 or the lower 16 bits of label's address
Operands
$t1- Any general-purpose register,
$0to$31, using its numeric or named spelling, such as$8or$t0($zerois$0;$rais$31). $t2- A general-purpose register. It may be the same register as
$t1. uimm16- An unsigned 16-bit immediate,
0to65535. imm32- A 32-bit immediate,
-2147483648to4294967295. A pseudo-instruction that takes one uses the register$atas a temporary, so$atloses the value it held. imm- An immediate value: an unsigned 16-bit value (
0to65535) or a 32-bit value (-2147483648to4294967295). The size your value needs decides which real instructions the assembler uses. Open the row to see them for each size. label- A named address in the program, such as the start of a loop or a variable in
.data.
The 16-bit immediate is zero-extended before the OR. Commonly used to set specific bits or to load a small non-negative constant into a register (e.g. after 'lui').
# Set low nibble bits. Inspect $t2: 0x35.
li $t0, 0x30
ori $t2, $t0, 5