测试说明-如何运作? [英] TEST Instruction - how it works?

查看:91
本文介绍了测试说明-如何运作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解以下组装线:

TEST DL,DL
JE SHORT 6C250EDF

因此,在DL中,我们有字符"C".实际上,值43是43的ANSCII代码. 我知道TEST就像AND,但是在TEST中我们不存储结果.

So, in DL we have the character 'C'. Actually, the value 43 which is ANSCII code for 43. I know that TEST is like AND, but in TEST we don´t store the result.

但是ollydbg表示不进行跳转.怎么可能呢? 43 AND 43相等,对吗? 那么,为什么不跳呢?

But ollydbg says that the jump is not taken. How that can be? 43 AND 43 is equal, right ? so, why not jump?

我的第二个问题是:如何用C代码将其翻译?

my second question would be: How can i translate that in C code ?

推荐答案

您是正确的,TEST对它的操作数进行逻辑AND,但是您的JE测试会检查Zero标志,并且当AND的结果时,测试指令会设置ZF为零,只有在DL为零时才会发生:

You are right that TEST does logical AND on its operands, but your JE test checks the Zero flag, and the test instruction sets the ZF when the result of AND is zero, which only happens when DL is zero:

http://en.wikipedia.org/wiki/TEST_%28x86_instruction%29

这篇关于测试说明-如何运作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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