As well as general purpose registers, the architecture defines system registers. System registers are used to configure the processor and to control systems such as the MMU and exception handling.
System registers cannot be used directly by data processing or load/store instructions. Instead, the contents of a system register need to be read into an
X register, operated on, and then written back to the system register. There are two specialist instructions for accessing system registers:
MRS Xd, <system register>
reads the system register into
MSR <system register>
Xn to the system register.
System registers are specified by name, for example
MRS X0, SCTLR_EL1
System register names end with
_ELx specifies the minimum privilege necessary to access the register. For example:
requires EL1 or higher privilege.
requires EL2 or higher privilege.
requires EL3 privilege
Attempting to access the register with insufficient privilege results in an exception.
Note: Sometimes you will see
_EL01. These are used as part of virtualization. Refer to the guide on virtualization for more information.