Title says it all. The error NASM gives (dispite my working OS) is "invalid effective address".
Now i've seen many examples of how to use LEA and i think i gots it right but yet my NASM dislikes it. I tried "lea cx, [cx+9]" and it worked; "lea cx, [bx+cx]" didn't.
Now if i extended my registers to 32-bits (i.e. "lea ecx, [ecx*8+ecx]") everything would be well but i am restricted to use 16- and 8-bit registers only.
Is here anyone so knoweledgeable who could explain me WHY my assembler doesn't let me use lea the way i supposed it should be used?
Thanks.
Edit
Thank you for the link. How ever the 0x67 prefix confused me: It allows me to use 32-bit addresses thus overriding real mode's 1MB memory limitation??? I it still doesn't enable all possible register conbinations for e.g. LEA...
-Larz
You can override real mode's 1MB memory limitation even with 16 bytes, for instance with this sequence: mov ax, 0xffff; mov ds, ax; mov bx, ds:[ax]. Now ds:[ax] = 10FFEF > 0xfffff, so you've accessed more than 1MB. – Nathan Fellman