CFM880

导航

2.3 ARM寄存器详解

一共有37个寄存器

1. 31个通用寄存器

2. 6个状态寄存器

R13作为堆栈指针

R14链接寄存器

1.保存函数返回地址

2. 异常返回地址

R15程序计数器(PC指针)

程序状态寄存器

只有在异常时才有程序状态寄存器

 

为什么有两个CPSR

SPSR当异常发生时保存CPSR的地址

当异常结束时SPSR将之前保存的地址给CPSR

程序状态寄存器的数据格式

N    Is set to bit 31 of the result of the instruction. If this result is regarded as a two's complement
signed integer, then N = 1 if the result is negative and N = 0 if it is positive or zero.

Z    Is set to 1 if the result of the instruction is zero (this often indicates an equal result from a
comparison), and to 0 otherwise.

I bit     Disables IRQ interrupts when it is set.

F bit    Disables FIQ interrupts when it is set.

M     标识处理器的工作模式

获取和设置工作模式

posted on 2015-09-13 20:54  CFM880  阅读(602)  评论(0)    收藏  举报