ARM 汇编指令 CPS CPSID CPSIE

前言

  • 移植基于ARM平台的RTOS时,需要掌握一些基本的汇编指令,只有熟悉了这些ARM 的汇编指令,才能真正的掌握RTOS的移植方法

CPSID

CPS

  • 原来 CPSID 是由 CPS 与 ID 两个部分组成的

  • CPS (Change Processor State) changes one or more of the mode, A, I, and F bits in the CPSR, without changing the other CPSR bits.

  • 更改处理器状态,单独更改 A、 I、 F CPSR的寄存器的位

  • CPS is only permitted in privileged software execution, and has no effect in User mode.

  • CPS 指令用于需要在特权模式下使用,也就是默认C的代码在用户模式,不能直接操作CPS指令,需要使用汇编来操作

  • CPS cannot be conditional, and is not permitted in an IT block.

  • CPS 不能中断阻塞

CPS 的Mode

  • IE : Interrupt or abort enable. 中断或 abort异常 使能

  • ID : Interrupt or abort disable. 中断或 abort 异常 禁能

CPS flags

  • a : Enables or disables imprecise aborts. abort 异常

  • i : Enables or disables IRQ interrupts. IRQ中断

  • f : Enables or disables FIQ interrupts. FIQ中断

CPSID

  • CPSID : Change Processor State Interrupt or abort disable : 禁用IRQ中断或abort异常

CPSID I

  • CPSID I : Change Processor State disables IRQ interrupts : 禁用 IRQ 中断

CPSIE

  • CPSID : Change Processor State Interrupt or abort enable : 使能IRQ中断或abort异常

CPSIE I

  • CPSID : Change Processor State enable IRQ interrupts : 使能IRQ中断

小结

  • 通过查看ARM官方的文档,真正了解 CPSID 与 CPSIE的 作用与用法
  • 7
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zhangsz_sh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值