Possible Duplicate:
Confusing add command in x86 assembly
I would like to understand these two lines of Assembly:
8048d74: 03 44 9e fc add -0x4(%esi,%ebx,4),%eax
8048d78: 39 04 9e cmp %eax,(%esi,%ebx,4)
I think (%esi,%ebx,4) is an effective address of the form (BASE, INDEX, SCALE)
I believe the add command is taking the value at %eax, adding it to the value at [esi + ebx*4 + mem_location] and storing it in that same spot.
Then, the cmp instruction tests whether the value at [esi + ebx*4 + mem_location] is equal to the value at %eax.
So, this will return true only if one of the two values added is 0, right?
This appears to be AT&T format source code, in which the order is
op source, dest. That means the first is adding the value at the effective address to eax. Then, the second line is comparing a second value to eax.