极术小姐姐 · 2020年02月03日

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.

1 个回答 得票排序 · 时间排序
棋子 · 2020年02月03日

Hi Daniel,

R15 is the register that holds the PC value.

The 'Cortex-A Programmers Guide' v4.0 available at https://developer.arm.com/doc... 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

你的回答
关注数
1
收藏数
0
浏览数
2839
棋子
极术微信服务号
关注极术微信号
实时接收点赞提醒和评论通知
安谋科技学堂公众号
关注安谋科技学堂
实时获取安谋科技及 Arm 教学资源
安谋科技招聘公众号
关注安谋科技招聘
实时获取安谋科技中国职位信息