It is currently Mon Oct 20, 2014 4:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Jul 11, 2009 12:20 pm 
Offline
 Profile

Joined: Thu Mar 26, 2009 3:49 pm
Posts: 3
Hi folks.

Okay

ver = 3

is fine, but

ver$ = "3.00"

is not. How do I define a string variable? I can't seem to find an answer on the BeebASM pages.

Thanks, Mark.


Top
 
PostPosted: Sun Jul 12, 2009 12:33 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
You can't, I'm afraid. String variables aren't supported by BeebAsm, mainly because I couldn't ever imagine why they would be useful.

What is it you'd like to do? Perhaps there's another way to achieve it (e.g. using IF...ENDIF or something).


Top
 
PostPosted: Wed Jul 29, 2009 1:12 am 
Offline
 Profile

Joined: Thu Mar 26, 2009 3:49 pm
Posts: 3
Hi.

(Sorry for late reply, I don't seem to be getting topic notifications)

It was simply for Version numbers and dates:

ver$ = "1.00"
date$ = "28 Jul 2009" or even better to be able to set it to the current date of the PC, so that it automatically assembles with the correct date.

So at the beginning of a ROM, I would have

EQUS ver$
EQUB &00
EQUS "("
EQUS date$
EQUS ")"

and later on in the help system, use ver$ again. Just so where the version appears in several places, I only have to keep track of one string.

Mark.


Top
 
PostPosted: Wed Jul 29, 2009 7:14 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
Oh I understand! I never expected BeebAsm to be used for serious apps like ROMs :D

I'll have a think about whether I can implement string variables easily (they're a whole different beast to a numeric variable and have very limited use in BeebAsm).

Perhaps a better solution would now be to implement a kind of basic macro system, even something akin to #define in C/C++, which does a fairly simple substitution. I'll see if I can find time to play with this idea sometime soon.


Top
 
PostPosted: Wed Jul 29, 2009 7:17 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
Another thought for now (a hacky one at that) is to try running the source file first through the C preprocessor (cpp.exe) in GCC, and then you could use #define to implement this. The only potential problem is, because BeebAsm source files don't have C-like syntax, it might not process it properly. Maybe worth a try though...


Top
 
PostPosted: Tue Sep 15, 2009 1:48 pm 
Offline
 Profile

Joined: Thu Nov 06, 2008 1:13 am
Posts: 14
RetroClinic wrote:
Hi.

(Sorry for late reply, I don't seem to be getting topic notifications)

It was simply for Version numbers and dates:

ver$ = "1.00"
date$ = "28 Jul 2009" or even better to be able to set it to the current date of the PC, so that it automatically assembles with the correct date.

So at the beginning of a ROM, I would have

EQUS ver$
EQUB &00
EQUS "("
EQUS date$
EQUS ")"


What I did for dates was to write a little external program that spits out the date in the apropreate format for my assembler, add a command to run that to my Makefile, and include the output.

I could let you have a copy of that if youi want.

Cheers.

Phill.


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
cron