0
.model  small
.stack  100H
.data
A   db   'This is   a  test   $'
B   db   100 dup('$')
.code
    mov ax, @data
    mov ds, ax
mov dx,offset A
mov cx,0000h
mov al,'$'
mov ah,' '
strt:
cmp al,[dx]
JE sof
cmp ah,[dx]
JE addd
jmp strt
addd:
inc dx
inc cx
sof:
.exit
end

I got two illegal indexing mode errors in the two cmp lines .

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
  • Check typo and mark code ba adding four spaces in front of each line – Jonas Wilms Aug 13 '16 at 15:00
  • 1
    That's because there's no such addressing mode as `[dx]`. In 16-bit mode assembly you're restricted to only using certain combinations of base and index registers. – Ross Ridge Aug 13 '16 at 15:04
  • 1
    [16-bit addressing modes](https://courses.engr.illinois.edu/ece390/books/artofasm/CH04/CH04-2.html#HEADING2-23) – Michael Petch Aug 13 '16 at 15:09

0 Answers0