0

在 ARM 中,Thumb-EE 指令集支持自动空指针检查。

In ThumbEE state, the processor uses almost the same instruction set as Thumb-2 although     some instructions behave differently, and a few are removed, or added.
The key differences are:
additional state changing instructions in both Thumb state and ThumbEE state
new instructions to branch to handlers
null pointer checking on loads and stores
an additional instruction in ThumbEE state to check array bounds
some other modifications to the load, store, and branch instructions

ARM 手册说,当 thumb-EE 指令试图引用一个空指针时,一个“处理程序将被调用”。但是谁设置了这个处理程序的地址?怎么样?,什么时候?我无法从 ARM Thumb-EE 手册中得到答案。

4

1 回答 1

2

请参阅 ARM 体系结构参考手册 (ARM DDI 0406C) 中的“B1.12 Thumb 执行环境”部分。

ThumbEE 检查处理程序的基地址保存在TEEHBR寄存器中,该寄存器位于 CP14 sysrem 寄存器空间中:

MRC p14, 6, <Rt>, c1, c0, 0 ; Read TEEHBR into Rt
MCR p14, 6, <Rt>, c1, c0, 0 ; Write Rt to TEEHBR

请注意,与 Jazelle 一样,ThumbEE 已被 ARM 弃用。

于 2014-06-11T15:36:38.283 回答