Contex-M PSR(Program status registers) 寄存器

The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors

4.2.3 Program status registers
The Program Status Register is composed of three status registers:

  • Application PSR (APSR)

  • Execution PSR (EPSR)

  • Interrupt PSR (IPSR)
    在这里插入图片描述These three registers (Figure 4.5) can be accessed as one combined register,
    referred to as xPSR in some documentation. In ARM assembler, when accessing xPSR (Figure 4.6), the symbol PSR is used. For example:

    MRS r0, PSR ; Read the combined program status word
    MSR PSR, r0 ; Write combined program state word
    

    在这里插入图片描述
    You can also access an individual PSR (Figure 4.5). For example:

    MRS r0, APSR ; Read Flag state into R0
    MRS r0, IPSR ; Read Exception/Interrupt state
    MSR APSR, r0 ; Write Flag state
    

    Please note:

    • The ERSR cannot be accessed by software code directly using MRS (read as zero) or MSR
    • The IPSR is read only and can be read from combined PSR (xPSR).
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值