What does 0x4 from cmp 0x4(%esi),%ebx assembly instruction mean?

白昼怎懂夜的黑 提交于 2019-12-24 13:12:44

问题


What does 0x4 from the following assembly line mean?

cmp 0x4(%esi),%ebx
je ...

When this compare returns equal and the jump is performed the registers have the values: %esi 0xe944d6d0 %ebx 0xe94ceccc

Sorry for asking such a simple question but I'm having a hard time searching such paranthesis notation with google. Spent more than half an hour while under time pressure.


回答1:


That is AT&T syntax, in Intel syntax it would be:

cmp ebx,[esi+4]

Note that the order of operands is reversed.

In Intel syntax it's dest, src. In AT&T it's src, dest.

So basically that instruction compares ebx with the dword value stored in [esi+4] by subtracting the dword value stored in [esi+4] from ebx, just like sub would do, but cmp only updates flags, it doesn't store the result anywhere.



来源:https://stackoverflow.com/questions/14878545/what-does-0x4-from-cmp-0x4esi-ebx-assembly-instruction-mean

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