组装测试说明 [英] Assembly Test Instruction

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

问题描述

我想知道此操作是什么意思?

I want to know what does this operation mean?

Test EDX, 200

我在EDX中具有DWORD值,例如:

1A1B1C00

当我做test EDX, 200 然后执行JE跳转.为什么? EDX不等于200.

When I do test EDX, 200 and then a JE, jump is taken. Why? EDX is not equal to 200.

我想进一步了解Test EDX, 200的含义.

I want to know more about Test EDX, 200 meaning.

推荐答案

test执行AND而不修改操作数(它仅修改某些标志,例如ZF等). je只需测试ZF(零标志),并在设置后跳转.

A test performs an AND without modifying the operands (it only modifies some flags, like ZF et al). A je simply tests ZF (the zero flag) and jumps if set.

因此,如果Test EDX, 200的结果为0,则Test EDX, 200AND中的值AND0x200一起设置,并将ZF设置为1.在您的情况下,这将为我们提供:

So Test EDX, 200 will AND the value in EDX with 0x200 and set ZF to 1 if the result of that AND was 0. In your case that will give us:

0x1A1B1C00 AND 0x00000200 -> 0x00000000

由于0x0200是二进制的0000 0010 0000 0000,所以指令Test EDX, 200的目的是测试EDX中的值,并查看第9位(从0开始,从右数9位)是否是01,如果为零,则进行跳转.

Since 0x0200 is 0000 0010 0000 0000 in binary, the intent of the instruction Test EDX, 200 is to test the value in EDX and see if the 9th bit (9 places from the right counting from 0) is a 0 or 1, and take the jump if it is a zero.

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

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