What is the difference between OR and ORI?
OR reads two registers, rs1 and rs2. ORI reads rs1 and uses a sign-extended 12-bit immediate.
Bitwise OR of rs1 and rs2, result in rd
OR (R-type) performs bitwise OR of rs1 and rs2, writing to rd. funct7=0000000, funct3=110. Used for setting bits (with masks), merging flag fields, and (less optimally) register moves with zero register.
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.
OR is an RV32I/RV64I base integer R-type logical instruction: it reads two XLEN-wide register values from rs1 and rs2, applies bitwise OR, and writes rd. It is useful for setting target bits selected by a mask or combining bit fields.
Understand this scenario with real code like «or x5, x6, x7 # x5 = x6 | x7».
Understand this scenario with real code like «or x5, x6, x7 # x5 = x6 | x7».
Understand this scenario with real code like «or x5, x6, x7 # x5 = x6 | x7».
OR reads two registers, rs1 and rs2. ORI reads rs1 and uses a sign-extended 12-bit immediate.
It produces the same register value, but the RISC-V Assembly Programmer's Manual commonly defines the mv pseudoinstruction as addi rd, rs1, 0.