Program Counter in AArch64 state
In AArch64 state, the Program Counter (PC) contains the address of the currently executing instruction. It is incremented by the size of the instruction executed, which is always four bytes.
In AArch64 state, the PC is not a general purpose register and you cannot access it explicitly. The following types of instructions read it implicitly:
- Instructions that compute a PC-relative address.
- PC-relative literal loads.
- Direct branches to a PC-relative label.
- Branch and link instructions, which store it in the procedure link register.
The only types of instructions that can write to the PC are:
- Conditional and unconditional branches.
- Exception generation and exception returns.
Branch instructions load the destination address into the PC.