Comment by HarHarVeryFunny

Comment by HarHarVeryFunny 20 hours ago

2 replies

LEA and MOV are doing different things. LEA is just calculating the effective address, but MOV calculates the address then retrieves the value stored at that address.

e.g. If base + (index * scale) + offset = 42, and the value at address 42 is 3, then:

LEA rax, [base + index * scale + offset] will set rax = 42

MOV rax, [base + index * scale + offset] will set rax = 3

dataflow 20 hours ago

I assumed they're referring to register-register moves?

  • HarHarVeryFunny 19 hours ago

    OK, so:

    LEA eax, [ebx]

    instead of:

    MOV eax, ebx

    But of course:

    MOV eax, [ebx]

    is not the same.