Search⌘ K
AI Features

Instruction Pointer

Explore how the ARM64 instruction pointer (PC register) tracks the next instruction during program execution. Understand the role of the PC and other registers while running logical instructions, and learn to examine program sections with GDB commands to analyze a program's data and code layout.

Working of pc registers

Consider these two execution steps. The pc is pointed at 0x00000000004000dc and see how it works below:

C++
0x00000000004000dc in _start ()
1: x/i $pc
=> 0x4000dc <_start+44>: ldr w3, [x1]
2: /x $x0 = 0x4100f0
3: /x $x1 = 0x4100f4
4: /x $x2 = 0x1
5: /x $x3 = 0x0
6: /x (int)a = 0x1
7: /x (int)b = 0x1
8: /x (long)pa = 0x4100f0
9: /x (long)pb = 0x4100f4

The kernel is running on ldr w3, [x1]. The value 1 is assigned ...