How does the `test` instruction work?

人走茶凉 提交于 2019-12-07 03:01:20

问题


If we have:

test dword ptr [eax], 2000h
je label1:

Is there any value other than 0 in dword ptr [eax] that would make the jump take place?


回答1:


Instruction test works like and instruction, the only difference is that result is not stored back in to the destination operand. So the answer is yes. All binary numbers which not have set the 13th bit on memory address [eax], or all numbers present like b'xxxxxxxx xxxxxxxx xx0xxxxx xxxxxxxx', where x is 0 or 1, there is exactly 2^31 numbers.



来源:https://stackoverflow.com/questions/4458368/how-does-the-test-instruction-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!