[ARM入门] MOV lr,pc指令问题?

[复制链接]
1985|2
 楼主| kkkkxxxx 发表于 2016-11-5 21:10 | 显示全部楼层 |阅读模式
0x00000180 46FE      MOV      lr,pc
//执行这条 MOV      lr,pc指令后为什么R14(LR)寄存器的值是0x00000184,而不是0x00000182呢?
0x00000182 EA810101  EOR      r1,r1,r1            
0x00000186 4700      BX       r0
lenglx 发表于 2017-1-11 12:40 | 显示全部楼层

Note
Use of the PC as the base register in the STC instruction is deprecated in ARMv7.

•        Read the word-aligned PC value, that is, the address of the current instruction + 4, with
bits [1:0] forced to zero. The base register of LDC, LDR, LDRB, LDRD (pre-indexed, no write-back),
LDRH, LDRSB, and LDRSH instructions can be the word-aligned PC. This enables PC-relative data
addressing. In addition, some encodings of the ADD and SUB instructions permit their source
registers to be 0b1111 for the same purpose.
feelhyq 发表于 2017-1-11 15:52 | 显示全部楼层
需要考虑指令的流水线的影响
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部