4

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.

4

1 回答 1

9

很确定原因是您不能将 DX 寄存器用作指针。

尝试使用 [si]、[di] 或 [bx]:

 lea bx, data0
 mov al, [bx]
于 2013-04-19T21:33:24.760 回答