CSRR
Control Status Register Read
CSRR rd, csr
Reads the value of a CSR into a register.
Encoding
Binary Layout
csr
31:20
00000010
19:12
rd
11:7
1110011
6:0
Operands
-
rd
Destination register (integer) -
csr
CSR Address
Example
CSRR x10, mstatus
// Read mstatus.
Related
More in Pseudo
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
CSRR is an assembler pseudoinstruction for CSRRS rd, csr, x0. It reads the CSR into rd without modifying it.
Operation
R[rd] = CSRs[csr];