组装测试说明 [英] Assembly Test Instruction
问题描述
我想知道此操作是什么意思?
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, 200
将AND
中的值AND
与0x200
一起设置,并将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位)是否是0
或1
,如果为零,则进行跳转.
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屋!