cps #27 arm汇编中这个指令是什么意思呢?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
可能就是个编号的意思:、
内核初始化堆栈编号……
————————————————————内核初始化堆栈指针
_coreInitStackPointer_
cps #17
ldr sp, fiqSp
cps #18
ldr sp, irqSp
cps #19
ldr sp, svcSp
cps #23
ldr sp, abortSp
cps #27
ldr sp, undefSp
cps #31
ldr sp, userSp
bx lr
——————————————————————
内核的代码没有研究过,不是很清楚,难得遇到楼主这么深入的人。
就是好奇而以,就是这个 cps #17 ,按你的意思这个就是给这些堆栈加一个编号的意思是嘛? 但是这些编号在什么地方会用到呢?
我上面贴的那段代码是设置堆栈指针,之前那个编号那些地方都有一段汇编代码的,可能是用于这个替换吧。为了使程序看起来更清晰。
嗯 假如我在其他地方用了cps #17 就会用 ldr sp, fiqSp 来进行替换是这样的嘛?
cps #17 @设置处理器模式为FIQ模式
ldr sp, fiqSp @设置FIQ模式的sp_fig栈指针值为fiqSp.
谢谢你的回答 这个不同的数字分别代表那种模式在什么文档中可以查到吖
ARM架构手册中,介绍CPSR寄存器的章节有关于模式位M【4:0】的说明。