문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top