Is the immediate zero-extended?
ORI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
Bitwise OR of rs1 with sign-extended 12-bit immediate, result in rd
ORI performs bitwise OR of rs1 with the sign-extended 12-bit immediate, writing to rd. Commonly used to set specific bits (masking), merge register values with constants, and combine with LUI to construct arbitrary 32-bit constants.
Uses the same rhythm as the ADDI page: machine-code fields, fixed-field identification, operand reads, instruction-specific execution, and ISA-visible state update.
The machine code is split by the current instruction format; the animation starts from encoding/decode.
This animation shows ISA-visible decode and state changes, not any specific CPU pipeline, cache, prediction, or timing implementation.
ORI is an RV32I/RV64I OP-IMM logical-immediate instruction: imm[11:0] is sign-extended to XLEN, ORed bit by bit with rs1, and written to rd. It is useful for setting bits represented by the encodable immediate.
Understand this scenario with real code like «ori x5, x6, 0x0F # x5 = x6 | 0x0F».
Understand this scenario with real code like «ori x5, x6, 0x0F # x5 = x6 | 0x0F».
Understand this scenario with real code like «ori x5, x6, 0x0F # x5 = x6 | 0x0F».
ORI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
No. Like the ordinary I-type integer-immediate instructions, ORI sign-extends the 12-bit immediate before the operation.