How does “mov (%ebx,%eax,4),%eax” work? [duplicate]

The complete memory addressing mode format in AT&T assembly is:

offset(base, index, width)

So for your case:

offset = 0
base = ebx
index = eax
width = 4

Meaning that the instruction is something like:

eax = *(uint32_t *)((uint8_t *)ebx + eax * 4 + 0)

In a C-like pseudocode.

Leave a Comment