flat assembler
Message board for the users of flat assembler.

Index > DOS > memory referencing: error: reserved word used as symbol

Author
Thread Post new topic Reply to topic
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent
Hi!

When I trying to compile such simple code, I got an error: reserved word used as symbol. Why?

Code:
use16 
org 100h
        mov             dx,081Fh
        mov             cx,083Fh
        mov             ax,[dx]   ; <- error
        mov             [cx],ax
        mov             ax,[dx+2]
        mov             [cx+2],ax
        mov             ax,4C00h
        int             21h
    


But when I write with EDX, it compiled successful.
Post 30 May 2005, 08:28
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
use bx instead of dx for indexing.
you can also use si, di, [es:di], [ds:si]
Post 30 May 2005, 09:16
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17463
Location: In your JS exploiting you and your system
revolution
In 16-bit mode DX is not available as an addressing register.

[BX], [SI], [DI], [BP], [BX+SI], [BX+DI], [BP+SI], [BP+DI] only can be used.
Post 30 May 2005, 09:23
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
Hmm, pretty weird error message. Shouldn't it be something like "invalid operand" or "must be index or base register?
Post 30 May 2005, 09:45
View user's profile Send private message Visit poster's website Reply with quote
IceStudent



Joined: 19 Dec 2003
Posts: 60
Location: Ukraine
IceStudent
Oh, I forgot about this.

Thanks!
Post 30 May 2005, 10:15
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.