I need to know the address that contains the next instruction to be executed in a A9 MPCore. That is, I need to read the Program Counter (PC). Where is the program counter? I can't find it in any document. Can you help me please?.
Best regards. Daniel.
R15 is the register that holds the PC value.
The 'Cortex-A Programmers Guide' v4.0 available at https://developer.arm.com/docs/den0013/d/cortex-a-series-programmers-guide-version-40 details this in sec. 3.1 'Registers'.
Also bear in mind that the PC value you see in the debugger's view may not be the actual PC value within the core.
The PC value on the core when it is executing A32 code is (executing instruction +8) and when it is executing Thumb instructions (T32) it is (executing instruction+4).
See sec. 3.1 again, but the paragraph starting "R15 is the program counter..." on p.3-7 in the above programmers guide.
I hope this helps
Dear Stuart Hirons;
Thank you very much for the quick response. It was helpfull.
View all questions in Cortex-A / A-Profile forum