Search code examples
assemblyx86gnu-assembler

Multiple args in assembly


What do multiple arguments like this do in x86 assembly. For example these two instructions:

mov -0x4(%edi,%esi,4),%eax

lea (%edi,%esi,4),%ebx

I'm reluctant to post all of the assembly code because it's for a university project and my teacher probably wouldn't want me posting this online. Any help appreciated.


Solution

  • The first instruction loads the (32 bit) value at the address: (%edi + %esi * 4) - 4, into %eax. The second sets %ebx to: (%edi + %esi * 4).