CSRW
Control Status Register Write
CSRW csr, rs
Writes a register value to a CSR.
Encoding
Binary Layout
csr
31:20
rs1
19:15
001000001110011
14:0
Operands
-
csr
CSR Address -
rs
Source
Example
CSRW mepc, x10
// Write address in x10 to mepc.
Related
More in Pseudo
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
CSRW is an assembler pseudoinstruction for CSRRW x0, csr, rs1. It writes rs1 to the CSR without reading it.
Operation
CSRs[csr] = R[rs];