chengfangming

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     标识处理器的工作模式

获取和设置工作模式

分类:

技术点:

相关文章:

  • 2021-06-20
  • 2021-07-03
  • 2021-06-23
  • 2021-03-28
猜你喜欢
  • 2022-12-23
  • 2021-07-10
  • 2021-07-05
  • 2021-11-23
  • 2021-06-06
相关资源
相似解决方案