What is mov doing here?
mov(%ebx,%eax,4),%eax
I\'ve seen mov used to transfer a value from one function to another, but I\'m not sure how to ha
segment:displacement(base register, offset register, scalar multiplier)
[in AT&T syntax is equivalent to]segment:[base register + displacement + offset register * scalar multiplier]
in Intel syntax. (source)
So mov(%ebx,%eax,4),%eax
is equivalent to mov eax, [ebx + eax*4]
. That is, form an address by ebx + eax*4
and load a doubleword from that address into eax
.