CMP in x86 with parentheses and address

后端 未结 2 999
谎友^
谎友^ 2020-12-04 02:46

I have the following line in x86 Assembly language that I don\'t know what it does...

cmp %eax,0x80498d4(,%ebx,4)

I know it\'s comparing th

2条回答
  •  醉话见心
    2020-12-04 03:07

    In AT&T syntax this form represents

    OFFSET(BASE REGISTER, INDEX REGISTER, INDEX SCALE)

    so the address represented is the value of BASE REGISTER (if present) + INDEX * SCALE (if present) + OFFSET, so

    EBX*4 + 0x80498d4 in your case.

提交回复
热议问题