Atomically read the old CSR value into rd and write rs1 to the same CSR; rd=x0 suppresses the CSR read
RISC-V Instruction Set Online Reference
RVOPcode is a developer-focused RISC-V instruction set online reference. Search by mnemonic, extension, function, scenario, register name, CSR name, or topic to quickly find instruction syntax, encodings, examples, pseudo-instruction expansions, ABI rules, and CSR field details.
Search directly by mnemonic, ABI name, CSR name, or topic keyword.
Recent Searches
Core Entry Points
Instruction Library
Look up RISC-V instruction syntax, encoding, semantics, examples, and related instructions
Instruction Encoder
Encode RISC-V assembly into machine code with opcode, funct fields, and immediate breakdown, then continue into formats and the instruction reference
Instruction Decoder
Decode a 32-bit machine word into assembly, format, and field layout, then continue into instruction details and encoding rules
Register Quick Reference
Browse x0-x31 registers online with ABI names, save conventions, and usage
CSR Reference
Find control and status register addresses, access rules, privilege levels, and related architectural state
Pseudo Instructions
See how RISC-V pseudo instructions expand to real instructions such as call, ret, li, and mv, then jump into the real instruction pages
Browse By Multiple Dimensions
Instruction of the Day
Instruction LibraryAdd the 32-bit U-immediate offset to this instruction's PC; RV64 sign-extends the offset before writing rd
Jump to PC-relative offset, storing return address (PC+4) in rd
Branch to PC-relative offset if rs1 equals rs2
Register Quick Reference
RV32 / RV64 Compare| Register | ABI | Role | Saved by |
|---|---|---|---|
| x0 | zero | Zero constant | Immutable |
| x1 | ra | Function return address | Not preserved across calls |
| x2 | sp | Stack pointer | Preserved across calls |
| x3 | gp | Global pointer; unallocatable and not modified by standard ABI procedures. | Unallocatable |
| x4 | tp | Thread pointer; unallocatable and not modified by standard ABI procedures. | Unallocatable |
| x5 | t0 | Temporary / alternate link register | Not preserved across calls |
| x10 | a0 | Argument / Return value | Not preserved across calls |
| x11 | a1 | Argument / Return value | Not preserved across calls |