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 uses the R-type encoding: it reads the XLEN-bit values in rs1 and rs2, performs a bitwise OR, and writes the result to rd. Its fixed fields are opcode=0110011, funct3=110, and funct7=0000000.
Starts with machine-code field decoding, then shows 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.
No. OR uses rs1 and rs2 in the R-type encoding; ORI is the bitwise-OR form with a sign-extended 12-bit immediate.