Question

I am writing an 8086 assembly program that needs to compile through TASM v3.1. I am running into an error I can not seem to fix.

My data segment has the following set up for the purposes of keyboard input:

paraO Label Byte
  maxO DB 5
  actO DB ?
  dataO DB 5 dup('$')

What I am trying to do is get the first character entered, so the first byte of dataO:

lea dx, dataO
mov bl, [dx]

However, when I attempt to compile, I get this error:

**Error** h5.asm(152) Illegal indexing mode

Line 152 is "mov bl, [dx]"

Any help would be greatly appreciated. If it matters, I am running TASM through DOSBox (My laptop is running 64-bit Win7) Google hasn't come up with any helpful answers. I can post the entirety of my code if necessary.

Was it helpful?

Solution

pretty sure the reason is that you can't use the DX register as a pointer.

try instead using [si], [di] or [bx]:

 lea bx, data0
 mov al, [bx]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top