I randomly remembered I specifically used LA (which I'm guessing is the MIPS equivalent of LEA) when trying to accessing variables on the stack in a prior MIPS assembly course. However, in x86 32 intel , I realized I primarily use mov to access variables in the stack. I understand that LEA loads an address, and stores the address in a register, and then by dereferenced to change to obtain the value that was at that address.
I see that eax is will be equal to esp+4 dereferenced in both scenarios. What are the benefits of using one method over the other, in this scenario ? I wrote this code to obtain the arguments of the function by the way I'm curious bc my professor in my MIPS course told us to avoid using mov I don't remember at all why he would do so.
mov $eax [$esp+4]
vs
lea $eax [$esp+4]
mov $eax [$eax]