Mat*_*ery 107
JE并且JZ只是完全相同的不同名称:当ZF("零"标志)等于1 时的条件跳转.
(类似地,当条件跳转等于0 时JNE,JNZ它们只是不同的名称.ZF)
您可以互换使用它们,但您应该根据您的操作使用它们:
JZJNZ当你明确测试等于零的东西时,/ 更合适:
dec ecx
jz counter_is_now_zero
Run Code Online (Sandbox Code Playgroud)JE并且JNE在CMP指示之后更合适:
cmp edx, 42
je the_answer_is_42
Run Code Online (Sandbox Code Playgroud)
(一条CMP指令执行一次减法,并在保留标志的同时抛出结果的值;这就是为什么ZF=1当操作数相等而ZF=0它们不相等时得到的结果.)
hig*_*aro 34
从英特尔手册 - 指令集参考中,JE也JZ具有相同的操作码(74对于rel8/0F 84对于rel 16/32) JNE和JNZ(75对于rel8/0F 85对于rel 16/32)共享操作码.
JE和JZ他们的两个检查ZF(或零标志),尽管说明书中的第一个的描述稍有不同JE版本8和JZ版本8 ZF的用法,但它们基本上是相同的.
以下是手册第464,465和467页的摘录.
Op Code | mnemonic | Description
-----------|-----------|-----------------------------------------------
74 cb | JE rel8 | Jump short if equal (ZF=1).
74 cb | JZ rel8 | Jump short if zero (ZF ? 1).
0F 84 cw | JE rel16 | Jump near if equal (ZF=1). Not supported in 64-bit mode.
0F 84 cw | JZ rel16 | Jump near if 0 (ZF=1). Not supported in 64-bit mode.
0F 84 cd | JE rel32 | Jump near if equal (ZF=1).
0F 84 cd | JZ rel32 | Jump near if 0 (ZF=1).
75 cb | JNE rel8 | Jump short if not equal (ZF=0).
75 cb | JNZ rel8 | Jump short if not zero (ZF=0).
0F 85 cd | JNE rel32 | Jump near if not equal (ZF=0).
0F 85 cd | JNZ rel32 | Jump near if not zero (ZF=0).
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
117864 次 |
| 最近记录: |