Program counter-relative addressing
The ARM is an unusual processor in so many ways. You can use any register (i.e., r0
to r15
) as a pointer register. However, r15
is the ARM’s program counter. If you use r15
as a pointer register with an index, you are saying, “The operand is at this distance from where I am.” Here the “where I am” refers to the instruction itself. Figure 11.10 illustrates program counter-relative addressing.
Think about it. You give the address of data with respect to the program that’s using it and not an absolute address in memory. If you move the program in memory, the data is still the same distance from the instructions that access it, using program counter-relative addressing. The introduction of program counter relative addressing was one of the major advances in computer architecture. By the way, most branch instructions use program counter relative addressing because the destination of a branch is specified with...