Why ARM Keeps PC Ahead?


This behavior simplifies PC-relative addressing.
Example instruction:
LDR R0, [PC, #0]

If the instruction is at:
0x1000

PC already contains:
0x1008

So data is loaded from 0x1008.
This is commonly used for literal pools and constant loading.

The Key Insight
The PC does not point to the instruction currently executing.
It points to the instruction already fetched ahead in the pipeline.

In ARM state:
PC = Current Instruction Address + 8
because the processor pipeline has already fetched future instructions.

#EmbeddedSystems #ARM #Firmware #Microcontrollers #EmbeddedLearning #ComputerArchitecture

Comments

Popular posts from this blog

Why Do Microcontrollers Start with an Internal Oscillator?

What Happens Inside a Microcontroller in the First Few Microseconds After Power-On?

Why RISC is ideal for embedded systems