80x86 16-bit asm: lea cx, [cx*8+cx] causes error on NASM (compiling .com file)
- by larz
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.