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
 
Format I-Type
Opcode 0x00002073
Extension Pseudo

Operands

  • rd
    Destination register (integer)
  • csr
    CSR Address

Example

CSRR x10, mstatus

// Read mstatus.

Related

More in Pseudo

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];