Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?



Julienne Walker wrote:

....
one can easily see why lea exists:

mov ebx,mem
mov esi,2

; Simulate "lea edx[ebx+esi*4]"
mov edx,ebx
imul esi,4
add edx,esi

Stop right there! That's "lea".

mov eax,[edx] ; eax = 3

This is *not* part of what "lea" does. The confusing thing about "lea" is that it *looks* like a memory instruction, but it's an arithmetic instruction - just does the calculation, doesn't touch memory at all.

Hope that clears things up.

Best,
Frank
.