简体   繁体   中英

what does cmp do in assembly language

I was just wondering what this does. As of now I just think that it compares %rsp with %eax but Im not really sure what the 0x10 there for

cmp    0x10(%rsp),%eax

thanks for the help

That is AT&T syntax for comparing the DWORD at memory location (rsp+10h) to the value in eax . The Intel syntax equivalent is:

cmp eax,[rsp+10h]

If the syntax difference is what is confusing you, check out this site which gives a good basic comparison between the two.

BTW, comparing the value of rsp with eax would be (AT&T):

cmp %rsp,%eax

or (Intel):

cmp eax,rsp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM