Confusing add command in x86 assembly
问题 I was looking through some code and found 2 lines that perplexed me: add -0x4(%esi,%ebx,4),%eax cmp %eax,(%esi,%ebx,4) I am accustomed to the standard add src,dst and cmp x1,x2 and I'm not really sure what these lines are actually doing. I believe that it is compiled with GCC 回答1: That's using the Base + (Index * Scale) + Displacement addressing mode. At least, I think so. I'm not real familiar with the AT&T syntax. I think the Intel syntax would be: add eax,[esi + ebx*4 - 4] cmp [esi + ebx*4