CSRR

Control Status Register Read

CSRR rd, csr

Reads the value of a CSR into a register.

Details

CSRR is an assembler pseudoinstruction for CSRRS rd, csr, x0. It reads the CSR into rd without modifying it.

Pseudocode Operation

R[rd] = CSRs[csr];

Example

CSRR x10, mstatus

Encoding

Binary Layout
csr
31:20
00000010
19:12
rd
11:7
1110011
6:0
 
Format I-Type
Opcode 0x00002073
Extension Pseudo

Operands

  • rd
    Destination register (integer)
  • csr
    CSR Address