ARM指令条件码

EQ (Equal Z set)
 NE (Not equal Z clear)
 CS/HS (Carry set/unsigned higher or same C set)
 CC/LO (Carry clear/unsigned lower C clear)
 MI (Minus/negative N set)
 PL (Plus/positive or zero N clear)
 VS (Overflow V set)
 VC (No overflow V clear)
 HI (Unsigned higher C set and Z clear)
 LS (Unsigned lower or same C clear or Z set)
 GE (Signed greater than or equal N set and V set, or N clear and V clear (N == V))
 LT (Signed less than N set and V clear, orN clear and V set (N != V))
 GT (Signed greater than Z clear, and either N set and V set, or N clear and V clear (Z == 0,N == V))
 LE (Signed less than or equal Z set, or N set and V clear, or
N clear and V set (Z == 1 or N != V))
 AL (Always (unconditional) )
括号外面的是条件,括号里的是解释说明。默认条件是AL(always).
eg, 执行MOVS,一定会影响N,Z,C标志
比如MOVS r0, #1,执行后r0=1
Z=!r0=0; 是否为0
N=r0>>31=0;符号位
C=!(r0 >= 0)=0;是否有进位

SPSR是进入内核态时,比如进入中断,对CPSR的备份(spsr=cpsr),退出内核态时,再恢复回来(cpsr=spsr)
MOVS总是会影响CPSR, 包括N,Z,C标志位
执行MOV pc, lr,可能会影响到T标志位,执行MOVS pc, lr时,CPSR会被SPSR覆盖(内核态)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值