flat assembler
Message board for the users of flat assembler.

Index > DOS > what is wrong with Mov Dl, [Bx + Cx] ?

Author
Thread Post new topic Reply to topic
Hobo



Joined: 05 Jul 2007
Posts: 11
Hobo
i try to use:
Code:
Mov Dl, [Bx + Cx]    

but the compiler said:
Code:
error: reserved word used as symbol.    


so i tried simplifying it by doing this:
Code:
Mov Ax, Bx
Add Ax, Cx
Mov Dl, [Ax]    


and still got the same error...

I've found that
Code:
Mov Dl, [Bx]    

works, however other similar things do not...

why is it that some do not work?

Thanks in advance if anyone can shed any light on this... Razz


Last edited by Hobo on 13 Jan 2008, 08:21; edited 1 time in total
Post 13 Jan 2008, 08:11
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
.

Quote:
i try to use:
Quote:
Mov Dl, [Bx + Cx]

but the compiler said:
Quote:
error: reserved word used as symbol.



1. Famous old compiler bug: inappropriate report Sad

2. Your bug: only BX, BP, SI and DI are available for indexing in 16-bit code Sad

3. Please read FAQ on thread top about DOS and 16-bit (this bug isn't yet in, but I'll add it ASAP) Smile

EDIT : old thread here : http://board.flatassembler.net/topic.php?t=6823

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug


Last edited by DOS386 on 16 Jan 2008, 01:52; edited 2 times in total
Post 13 Jan 2008, 08:19
View user's profile Send private message Reply with quote
Hobo



Joined: 05 Jul 2007
Posts: 11
Hobo
wow fast reply lol, i edited my origonal post, thinking that no-one would have replied yet, i figured out that i could use bx on its own like you said, but thanks for clearing it up further lol
Post 13 Jan 2008, 08:23
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4240
Location: 2018
edfed
yes, DOS386 is THE hidden user, that is always connected, with revolution.
Post 13 Jan 2008, 08:31
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7755
Location: Kraków, Poland
Tomasz Grysztar
In the addressing expression symbols like AX and CX are not recognized as registers, because simply there are no such registers available for addressing. That's why assembler thinks when you write "cx", that you want to use some label of such name, but since such label is disallowed (as a reserved word), thus such error.
Post 13 Jan 2008, 10:38
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Still somewhat unnapropiate error since after all you are trying to read it not define it. For example fasm says "Error: reserved word used as symbol" with 'cx = a', but with 'a = cx' says "Error: invalid value". IMHO, fasm should say either "Error: invalid address" or less desired but more acceptable than current error message "Error: invalid value" but NO what it currently says.
Post 13 Jan 2008, 16:13
View user's profile Send private message Reply with quote
System86



Joined: 15 Aug 2007
Posts: 77
System86
Why not have fasm generate an "Error: invalid address" whenever an illegal expression is used for an address? That will make a lot more sense than "Error: reserved word used as symbol" and should be simple to implement, since it will have the same logic whenever there's a syntax error or bad register used in an address.
Post 13 Jan 2008, 17:37
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.