What does a comma in a parenthesis mean in the AT&T syntax for x86 assembly?

后端 未结 1 883
滥情空心
滥情空心 2020-11-30 14:57

What does (register1, register2, 4) mean in AT&T assembly?

For example:

cmp %eax, (%esi, %ebx, 4)
相关标签:
1条回答
  • 2020-11-30 15:59

    The complete AT&T base/index register syntax is:

    offset(base, index, multiplier)
    

    Your offset field is 0, so you just have the (base, index, multiplier) part. In your case, you're comparing the contents of the eax register to the 32-bit value located at esi + (ebx * 4).

    In the Intel syntax you might be more familiar with, this would be written as:

    cmp [ebx*4 + esi], eax
    
    0 讨论(0)
提交回复
热议问题