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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Query on QUERY?
PostPosted: Sat Nov 05, 2011 5:40 am 
Offline
User avatar
 Profile

Joined: Mon Jan 24, 2011 6:10 pm
Posts: 29
Hi Rich,
Just thought I'd throw another wishlist item into the pot (for whenever you get that free time) and feel like tweaking BeebASM just a little more... ;)

You've already got the PRINT directive for displaying a string and value of an expression during assembly. Well, how about a corresponding directive (e.g. QUERY), that operates on the 1st pass assembly that accepts an input at assembly time that displays a string and accepts an input, evaluated as a numeric expression?

Code:
QUERY "Debug Mode", debug_mode

If the resulting expression is invalid or contains a forward reference, the question/prompt is repeated.

So, for example, you normally define a symbol within your code such as :
Code:
"debug_mode = FALSE"

and subsequently test within your code if the symbol is TRUE or FALSE and take the appropriate (conditional assembly) action based on the value of the expression.
Thus, rather than have to hard-code a specific value into your code, you "QUERY" at assembly time and set a value based on the input, thus saving the trouble of editing the source code each time you want to change a given expression!

This can also be very useful for other conditional assembly options, such as ROM .vs. RAM, (etc.,etc.,...). Furthermore, within your code, assuming the input is evaluated as an expression and can contain symbols, you can then define within your code:

Code:
YES = -1
NO = 0

thus the answers to a "QUERY" can be more "English like" as opposed to requiring a numeric expression as a valid response (0 or -1, in this instance)...

Just a thought...

(I'm probably thinking too much... :roll: )

Definitely not a show stopper, but more of a "nice to have"...

As always, thoughts appreciated...

Martin.


Top
 
 Post subject: Re: Query on QUERY?
PostPosted: Mon Nov 07, 2011 9:31 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
I don't have much time to work on BeebAsm at the moment, but I'll bear it in mind for a later release.

In Blurp, I have a boolean symbol called DEBUG which determines whether certain development features are built into the code or not. I then just have two files, BlurpDebug.6502 and BlurpRelease.6502, which look like this:
Code:
; BlurpDebug.6502
DEBUG = TRUE
INCLUDE "Blurp.6502"
Code:
; BlurpRelease.6502
DEBUG = FALSE
INCLUDE "Blurp.6502"
where of course Blurp.6502 is the actual source code.

I use a Makefile to make Blurp builds and launch B-Em, so then it's just a case of typing 'make debug' or 'make release' at the command line to get the right type of build.

Another thing I've considered is the ability to define symbols on the command line, much like gcc, so you could say:
Code:
beebasm -i Blurp.6502 -do Blurp.ssd -DDEBUG=1


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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