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



pzgyuanf@xxxxxxxxxxxx wrote:
But, it is right to say '[ebx+esi*4]'(see below) is an effective
address:
mov ebx,mem
mov esi,2
lea edx [ebx+esi*4]

however, it is wrong to say '[mem]'(see below) is an effective address,
just the mem is:
mem dd 1,2,3,4,5
mov eax,[mem]

Is this right?

This is a case where the syntax of lea causes problems. In both cases,
whatever is between the square brackets is an effective address. The
difference is how the instruction uses the effective address. mov
evaluates the expression and then reads the contents from the resulting
address. lea evaluates the expression and then assigns the resulting
address to edx without touching the contents. But [mem] is no less an
effective address than [ebx+esi*4].

.



Relevant Pages

  • Re: Memory problem
    ... mov,eax; throw better results) ... using the REP prefix to repeatedly perform ... a loop may yield better performance due to its ... do a copy mem -> mem in one cycle. ...
    (comp.lang.asm.x86)
  • Re: Multithreading question...
    ... thread trying to set mem to 999999. ... __int32 volatile* src, ... MOV ECX, ...
    (comp.programming.threads)
  • Re: uses of xor
    ... xor [mem], reg ... mov eax, ... "almost all programming can be viewed as an exercise in caching" ...
    (comp.lang.asm.x86)
  • Re: Is it catachrestial as Effective Addresses in NASM documentation?
    ... the square-brackets-ed expression wasn't an effective address, ... the thing in the square brackets was an effective address, ... mov ebx,mem ... just the mem is: ...
    (alt.lang.asm)
  • Re: modify nasm
    ... I'm working in linux and I'd like tomodifyan assembler like nasm (or ... lea r23,5 ... mov r25,r0 ...
    (alt.lang.asm)