ARM指令中标志位的定义
2014-08-08 07:19
204 查看
C flag:For a subtraction, including the comparison instruction CMP, C is set to 0 if the subtraction produced a borrow (that is, an unsigned underflow), and to 1 otherwise.
Z flag: Is set to 1 if the result of the instruction is zero (which often indicates an equal result from
a comparison), and to 0 otherwise.
In either case, the new condition code flags (after the instruction has been executed) usually mean:
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 (which often indicates an equal result from
a comparison), and to 0 otherwise.
C Is set in one of four ways:
• For an addition, including the comparison instruction CMN, C is set to 1 if the addition
produced a carry (that is, an unsigned overflow), and to 0 otherwise.
• For a subtraction, including the comparison instruction CMP, C is set to 0 if the
subtraction produced a borrow (that is, an unsigned underflow), and to 1 otherwise.
• For non-addition/subtractions that incorporate a shift operation, C is set to the last bit
shifted out of the value by the shifter.
• For other non-addition/subtractions, C is normally left unchanged (but see the
individual instruction descriptions for any special cases).
V Is set in one of two ways:
• For an addition or subtraction, V is set to 1 if signed overflow occurred, regarding the
operands and result as two's complement signed integers.
• For non-addition/subtractions, V is normally left unchanged (but see the individual
instruction descriptions for any special cases).
http://blog.csdn.net/shansan/article/details/3137216
Z flag: Is set to 1 if the result of the instruction is zero (which often indicates an equal result from
a comparison), and to 0 otherwise.
In either case, the new condition code flags (after the instruction has been executed) usually mean:
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 (which often indicates an equal result from
a comparison), and to 0 otherwise.
C Is set in one of four ways:
• For an addition, including the comparison instruction CMN, C is set to 1 if the addition
produced a carry (that is, an unsigned overflow), and to 0 otherwise.
• For a subtraction, including the comparison instruction CMP, C is set to 0 if the
subtraction produced a borrow (that is, an unsigned underflow), and to 1 otherwise.
• For non-addition/subtractions that incorporate a shift operation, C is set to the last bit
shifted out of the value by the shifter.
• For other non-addition/subtractions, C is normally left unchanged (but see the
individual instruction descriptions for any special cases).
V Is set in one of two ways:
• For an addition or subtraction, V is set to 1 if signed overflow occurred, regarding the
operands and result as two's complement signed integers.
• For non-addition/subtractions, V is normally left unchanged (but see the individual
instruction descriptions for any special cases).
http://blog.csdn.net/shansan/article/details/3137216
相关文章推荐
- linux kernel 对 ARM 未定义指令扩展的例子
- 头文件定义和ARM指令
- ARM指令中灵活的第二操作数
- Android NDK开发之 ARM与NEON指令说明
- 8051、ARM和DSP指令周期的测试与分析
- 哪些指令会改变汇编的标志位
- ARM Program Status Register 和 相关指令之笔记
- 【转载】arm指令
- ARM基本指令
- ARM与PC挂载指令
- Android逆向中常用的ARM汇编指令基础知识
- ARM指令中如何判断一个立即数是有效立即数
- Arm汇编 位置无关代码 adr 指令
- C# 001 --- 正确的删除一个控件的事件函数 --- 解决错误: “A”不包含“B”的定义,并且找不到可接受类型为“A”的第一个参数的扩展方法“B”(是否缺少 using 指令或程序集引用?)
- ARM汇编----伪指令LTORG
- ARM和NEON指令 very nice
- ARM汇编编程基础(二) -- 基本寻址方式与基本指令
- ARM应用系统开发详解:第3章 ARM微处理器的指令系统
- ARM WFI和WFE指令
- ARM汇编指令:LDR伪指令和LDR装载指令的区别