Is the immediate zero-extended?
XORI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
Bitwise XOR of rs1 with sign-extended 12-bit immediate, result in rd
XORI uses the I-type format. It XORs rs1 with a 12-bit immediate sign-extended to XLEN and writes rd. XORI rd, rs1, -1 flips every XLEN bit of rs1 and is the expansion for the assembler pseudoinstruction NOT rd, rs1.
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.
XORI is an RV32I/RV64I OP-IMM logical-immediate instruction: imm[11:0] is sign-extended to XLEN, XORed bit by bit with rs1, and written to rd. imm=-1 flips every XLEN bit of rs1.
Understand this scenario with real code like «xori x5, x6, -1 # x5 = ~x6 (bitwise NOT)».
Understand this scenario with real code like «xori x5, x6, -1 # x5 = ~x6 (bitwise NOT)».
XORI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
-1 is encoded as twelve ones and sign-extends to all ones at XLEN width; XOR with 1 flips each bit.