Other registers

Here are some other registers in the A64 that you should know about:

The zero registers, ZXR and WZR, always read as 0 and ignore writes.

You can use the stack pointer (SP) as the base address for loads and stores. You can also use the stack pointer with a limited set of data-processing instructions, but it is not a regular general purpose register.

Armv8-A has multiple stack pointers, and each one is associated with a specific Exception level. When SP is used in an instruction, it means the current stack pointer. The guide to the exception model explains how the stack pointer is selected.

X30 is used as the Link Register and can be referred to as LR.

Note: Separate registers, ELR_ELx, are used for returning from exceptions. This is discussed in more detail in the guide to the exception model.

The Program Counter (PC) is not a general-purpose register in A64, and it cannot be used with data processing instructions. The PC can be read using:

ADR Xd, .

The ADR instruction returns the address of a label, calculated based on the current location. Dot (‘.’) means 'here', so the shown instruction is returning the address of itself. This is equivalent to reading the PC. Some branch instructions, and some load/store operations, implicitly use the value of the PC.

Note: In the A32 and T32 instruction sets, the PC and SP are general purpose registers. This is not the case in A64 instruction set.

Previous Next