图解M0的xPSR

本文详细解析了Cortex-M0处理器中Application Program Status Register (APSR)的组成部分,包括N(负数标志)、Z(零标志)、C(进位标志)和V(溢出标志),以及它们在条件跳转指令中的应用。同时,介绍了Interrupt Program Status Register (IPSR)用于标识当前执行的中断服务例程,并且Execution Program Status Register (EPSR)中的T-bit指示处理器处于Thumb状态。
摘要由CSDN通过智能技术生成

 

• Application PSR (APSR)


The APSR contains the ALU flags: N (negative flag), Z (zero flag), C (carry or borrow flag),
and V (overflow flag). These bits are at the top 4 bits of the APSR. The common use of these
flags is to control conditional branches.

N (bit 31) Set to bit [31] of the result of the executed instruction. When it is “1”, the result has a negative
value (when interpreted as a signed integer). When it is “0”, the result has a positive value or
equal zero.
Z (bit 30) Set to “1” if the result of the executed instruction is zero. It can also be set to “1” after
a compare instruction is executed if the two values are the same.
C (bit 29) Carry flag of the result. For unsigned addition, this bit is set to “1” if an unsigned overflow
occurred

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值