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.
This example uses fixed initial register values and PC=0x2000; instruction fetch succeeds, with no asynchronous interrupt or extra extension checks. Exception branches stop ordinary commit; post-trap PC and handler state are EEI-dependent.
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.
RV32I/RV64I, x6=20 and x7=7: or x5, x6, x7 gives x5=23 (0x17), setting bits selected by ones in the mask.
RV32I/RV64I, x6=20 and x7=7: or x5, x6, x7 gives x5=23 (0x17), setting bits selected by ones in the mask.
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.