您的位置:首页 > 其它

条件转移指令

2013-01-21 16:33 232 查看
条件转移指令(Transfer Conditionally)

条件转移指令是一组极其重要的转移指令,它根据标志寄存器中的一个(或多个)标志位来决定是否需要转移,这就为实现多功能程序提供了必要的手段。微机的指令系统提供了丰富的条件转移指令来满足各种不同的转移需要,在编程序时,要对它们灵活运用。

条件转移指令又分三大类:基于无符号数的条件转移指令、基于有符号数的条件转移指令和基于特殊算术标志位的条件转移指令。

1、无符号数的条件转移指令(Jumps Based on Unsigned (Logic) Data)

指令的助忆符  检测的转移条件 功能描述 
JE/JZ   ZF=1 Jump Equal or Jump Zero 
JNE/JNZ ZF=0 Jump Not Equal or Jump Not Zero 
JA/JNBE CF=0 and ZF=0 Jump Above or Jump Not Below or Equal 
JAE/JNB CF=0 Jump Above or Equal or Jump Not Below 
JB/JNAE CF=1 Jump Below or Jump Not Above or Equal 
JBE/JNA CF=1 or AF=1 Jump Below or Equal or Jump Not Above 

2、有符号数的条件转移指令(Jumps Based on Signed (Arithmetic) Data)

指令的助忆符 检测的转移条件 功能描述 
JE/JZ ZF=1 Jump Equal or Jump Zero 
JNE/JNZ ZF=0 Jump Not Equal or Jump Not Zero 
JG/JNLE ZF=0 and SF=OF Jump Greater or Jump Not Less or Equal 
JGE/JNL SF=OF Jump Greater or Equal or Jump Not Less 
JL/JNGE SF≠OF Jump Less or Jump Not Greater or Equal 
JLE/JNG ZF=1 or SF≠OF Jump Less or Equal or Jump Not Greater 

3、特殊算术标志位的条件转移指令(Jumps Based on Special Arithmetic Tests)

指令的助忆符 检测的转移条件 功能描述 
JC CF=1 Jump Carry 
JNC CF=0 Jump Not Carry 
JO OF=1 Jump Overflow 
JNO OF=0 Jump Not Overflow 
JP/JPE PF=1 Jump Parity or Jump Parity Even 
JNP/JPO PF=0 Jump Not Parity or Jump Parity Odd 
JS SF=1 Jump Sign (negative) 
JNS SF=0 Jump No Sign (positive)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: