Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- From: "Julienne Walker" <happyfrosty@xxxxxxxxxxx>
- Date: 30 Apr 2006 08:54:23 -0700
Frank Kotler wrote:
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.
Sorry, the memory access wasn't meant to be a part of the lea
simulation at all. It just happened to be the next instruction since
all of the examples ended up accessing the effective address.
Consistency and whatnot. Would this work better?
; Simulate "lea edx[ebx+esi*4]"
mov edx,ebx
imul esi,4
add edx,esi
; Access the result
mov eax,[edx] ; eax = 3
.
- Follow-Ups:
- Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- From: Frank Kotler
- Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- References:
- Is it catachrestial as 'Effective Addresses' in NASM documentation?
- From: pzgyuanf
- Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- From: Julienne Walker
- Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- From: Frank Kotler
- Is it catachrestial as 'Effective Addresses' in NASM documentation?
- Prev by Date: Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- Next by Date: Re: I'd like to learn asm...
- Previous by thread: Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- Next by thread: Re: Is it catachrestial as 'Effective Addresses' in NASM documentation?
- Index(es):
Relevant Pages
|