Looking at compiler output for a simple function I see lines like lea eax, [rdi+rdi*4] and lea rax, [rsp+8]. The brackets made me think memory is being read, as in mov eax, [rdi], but stepping through in the debugger shows that nothing is loaded from memory.
What does LEA actually compute, how is it different from MOV with the same operand, and why would a compiler use it for plain arithmetic instead of ADD or IMUL?




