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
imm[11:0]
31:20
rs1
19:15
010
14:12
rd
11:7
1110011
6:0
 
Format I-Type
Opcode 0x73
Extension Pseudo

Operands

  • rd
    Destination register (integer)
  • csr
    CSR Address