JNZ&CMP 组装说明 [英] JNZ & CMP Assembly Instructions

查看:66
本文介绍了JNZ&CMP 组装说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我错了,请纠正我.

Correct me if I am wrong.

这是我对JNZCMP的理解.

JNZ - 如果 Z 标志不为零 (1)

JNZ - The jump WILL take place if the Z Flag is NOT zero (1)

CMP - 如果两个值相等,则设置 Z 标志 (1) 否则不设置 (0)

CMP - If the two values are equal, the Z Flag is set (1) otherwise it is not set (0)

这是我正在观看的 Flash 教程.它正在教一个简单的 CrackMe 的解决方案.

This is a flash tutorial I am watching. It is teaching the solution to a simple CrackMe.

如您所见,前面的指令将 AL47h 进行了比较.它们相等,设置了 Z 标志.(您可以在右侧的寄存器窗口中看到它)

As you can see, the previous instruction compared AL with 47h. They were equal which set the Z flag. (You can see it in the Registers windows on the right side)

下一条指令是JNZ.我的理解是,如果设置了 Z 标志,就会发生跳转.Z 标志已设置,但没有发生跳转!

The next instruction is a JNZ. My understanding was that the jump will take place if the Z flag is set. The Z flag IS set, but the jump doesn't take place!

为什么?

推荐答案

JNZ 是Jump if not zero (ZF = 0)"的缩写,NOTJump if the ZF is set".

JNZ is short for "Jump if not zero (ZF = 0)", and NOT "Jump if the ZF is set".

如果更容易记住,请考虑 JNZ 和 JNE(如果不相等则跳转)是等价的.因此,当您在执行 cmp al, 47 并且 AL 的内容等于 47 时,ZF 已设置,因此跳转(如果不等于 - JNE)不应该被带走.

If it's any easier to remember, consider that JNZ and JNE (jump if not equal) are equivalent. Therefore, when you're doing cmp al, 47 and the content of AL is equal to 47, the ZF is set, ergo the jump (if Not Equal - JNE) should not be taken.

这篇关于JNZ&CMP 组装说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆