This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Address memory of the next instruction in A9 MPCore

Hi all;

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.

Parents
  • Hi 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

    Regards,

    Stuart

Reply
  • Hi 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

    Regards,

    Stuart

Children