最近在学 ARM 汇编,看到 LDM 指令的时候有个问题看不懂了。
Loading to the PC
A load to the PC causes a branch to the instruction at the address loaded.In ARMv4, bits[1:0] of the address loaded must be 0b00.
In ARMv5T and above:
bits[1:0] must not be 0b10
- if bit[0] is 1, execution continues in Thumb state
- if bit[0] is 0, execution continues in ARM state.
这是ARM官方对 LDM 指令读数据 PC 寄存器的描述。
为什么 bit[0] 置 1 之后,接下来就进到 Thumb 模式继续执行了呢。Tumb 指令两字节对齐,bit[0] 应该也是 0 吧。