Jump to content
Sign in to follow this  
BeeryMiller

GenASM Conditional Assembly

Recommended Posts

Got a question regarding the GenASM program.

 

I am using GenASM and working on a TI-99/4A program.

 

I am wanting to add some conditional assembly code.  In my case, I want to be able to assemble two versions of the same program.  First "program" is 40 column capability.  Second "program" is with 80 column capability.  Basically, if the assembly is for 80 column, it uses code to setup for 80 columns.  If for 40 column, another section of code.  Since there are scroll routines, etc., there would be additional places in the code if scrolling for 40 columns, use one particular set of boundaries, and for 80 columns, another set of boundaries.  There are other tweaks as well.

 

Paul's GenASM manual indicates the use of the IF THEN ELSE assembly, but I do not see or understand how to set the condition for the assembly.

 

Feedback is appreciated.

 

Beery

 

  • Like 1

Share this post


Link to post
Share on other sites

I know this is not an answer to the question, and falls into the kind of response I personally don't like (when people question the reason for doing something in the first place, rather than trying to help with a solution).  But, I'll ask anyway, but mostly just out of curiosity: Why not just manage the handful of variables needed to allow your code handle both 40 and 80 columns at run time?  This would allow you to make selecting 40/80 columns at runtime, and you only have one code-base and final executable to manage.

 

The answer "because I don't want to" is perfectly acceptable. 🙂

 

 

Edited by matthew180
Trying to sound like less of a jerk.
  • Like 1

Share this post


Link to post
Share on other sites

I'm having to do a similar thing, but with RAM with my SuperNotes program, some users may have a 1meg SAMS and others may have 32K...so I'm writing to fulfill both needs, as I'm checking first if a SAMS card is present THEN i still ask the user if they want to use the SAMS version..I still give the user a choice.

no stone unturned.

 

Edited by GDMike

Share this post


Link to post
Share on other sites

Check the MDOS Source code, CLI or HEAD folder. If I recall correctly, the source file that sets the displayed "compiled on" version message uses conditionals to encode the month text.  VERS? VERNUMS?  The file name escapes me at the moment.

Share this post


Link to post
Share on other sites
Just now, InsaneMultitasker said:

Check the MDOS Source code, CLI or HEAD folder. If I recall correctly, the source file that sets the displayed "compiled on" version message uses conditionals to encode the month text.  VERS? VERNUMS?  The file name escapes me at the moment.

Thanks Tim.  Will look into it.

 

Beery

Share this post


Link to post
Share on other sites
2 hours ago, matthew180 said:

I know this is not an answer to the question, and falls into the kind of response I personally don't like (when people question the reason for doing something in the first place, rather than trying to help with a solution).  But, I'll ask anyway, but mostly just out of curiosity: Why not just manage the handful of variables needed to allow your code handle both 40 and 80 columns at run time?  This would allow you to make selecting 40/80 columns at runtime, and you only have one code-base and final executable to manage.

 

The answer "because I don't want to" is perfectly acceptable. 🙂

 

 

Well, the answer isn't "because I don't want to".  

 

The big issue is the handling of the 40 and 80 columns and the way the original author handled line breaks in text prompts.  It is a bit more than just a few variables, and I am doing my best to try and keep the code under 24K without having utilize cartridge space RAM at >6000.  Lower memory is being used for all kinds of buffers, etc.

 

Beery

 

Share this post


Link to post
Share on other sites

Beery I don't know if the code can do this but the way that my BBS software handles 40/80 is by using a character such as "|" to represent either a CR/LF or a space.  In the print routines I check a flag - if on, I replace with space; if off, replace with CR/LF.  I rarely use the character so I don't worry about escaping it, i.e., using a double || to print a single one.  I can change the character used to represent the crlf/space conversion easily enough.  The software like its predecessor also uses the tilde to represent crlf, so I can also tell the software to exchange a | for a ~, which then generates a crlf. 

Share this post


Link to post
Share on other sites

Tim,

 

Thanks for that idea.  Staring at the use of >D in the TEXT strings left me oblivious to that idea.  That would be fairly easily to implement for handling the strings.  Thanks again for the idea.


Beery

 

Share this post


Link to post
Share on other sites
9 hours ago, InsaneMultitasker said:

Check the MDOS Source code, CLI or HEAD folder. If I recall correctly, the source file that sets the displayed "compiled on" version message uses conditionals to encode the month text.  VERS? VERNUMS?  The file name escapes me at the moment.

The file is in CLI\HTITLES as one example.

 

The problem I see with that example is he is reading variables GenASM has access too by reading the day and month.  Gotta figure out how to generate an example that is conditional that GenASM does not have access to by default.  Unless of course, I make the 40 and 80 column version assembly process conditional upon the day, month, or year which is one possibility I guess.

 

The other possibility is to move the 40 / 80 column routines into separate source files similar to what was originally done with the floppy only version of MDOS and the HFDC/SCSI versions of MDOS.

 

Beery

 

Share this post


Link to post
Share on other sites

I put together a test, and got the conditional assembly to work.  Here is an example using GenASM.

 

 

MDOS    EQU   1

             IF      MDOS

             TEXT  'MDOS Test'

             ELSE

             TEXT 'GPL Test'

             FI

 

If MDOS =1, I get the MDOS text.  If MDOS = 0, I get the GPL test compiling.

 

Beery

 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...