Possible Duplicate:
What's the purpose of the LEA instruction?
When I need the value at an address I can use the effective address e.g. push dword [str+4]
. But when I need to reference an address -- I can't use push dword str+4
(which to me is the obvious and intiutive way to do it).
Instead need to use lea EAX, [str+4]
and then push EAX
. This a bit confusing and also gives an extra processor instruction, albeit a 'zero-clock' one. (See this answer)
Is there some hardware level explaination for this difference, or is it just a quirk of (NASM) assembly syntax?
Edit: Okay so this comment asks the same question as me. And it is answered in this comment just as Lucero's answer - the X86 does not support such addressing.