New community dev tool uploaded: Basic Label Compiler for Windows

All aspects of programming on the Commander X16.
Post Reply
Johan Kårlin
Posts: 292
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

New community dev tool uploaded: Basic Label Compiler for Windows

Post by Johan Kårlin »




Basic Label Compiler for Windows




View File






Writing BASIC programs longer than 10 rows on the X16 is a tedious experience. The text editor is very limited, much is about struggling with row numbers. This is an extremely simple compiler (sort of at least) for Windows that lets you write your BASIC programs in your favourite text editor with labels. The compiler outputs a new text file with the extension ".bas". It adds row numbers and fills in the right row number after the commands "GOTO", "GOSUB" and "THEN".

No installation is needed, just copy the only file to the directory of your choice. 

Usage: x16LabelCompiler <filename> [first row number] [step between row numbers]


  • Labels must end with a colon (":").


  • Labels must not be reserved keywords in BASIC.


  • Labels are preserved in the generated code by inserting "REM" before them.


  • Empty rows are removed.


  • All letters are converted to uppercase.


A sample program called "guess_the_number.txt" is included.

To compile the program:  x16LabelCompiler guess_the_number.txt

To start the emulator, load the generated file and run it immediately: x16emu -bas guess_the_number.bas -run






 
ZeroByte
Posts: 714
Joined: Wed Feb 10, 2021 2:40 pm

New community dev tool uploaded: Basic Label Compiler for Windows

Post by ZeroByte »


That's pretty cool.

SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

New community dev tool uploaded: Basic Label Compiler for Windows

Post by SlithyMatt »


Next stop: Native QBasic on the X16.

Johan Kårlin
Posts: 292
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

New community dev tool uploaded: Basic Label Compiler for Windows

Post by Johan Kårlin »



On 11/9/2021 at 10:57 PM, SlithyMatt said:




Next stop: Native QBasic on the X16.



QBasic is still beyond the horizon but I have made some improvements in v 2.0. ?

mobluse
Posts: 177
Joined: Tue Aug 04, 2020 2:16 pm
Location: Lund, Sweden
Contact:

New community dev tool uploaded: Basic Label Compiler for Windows

Post by mobluse »


There is a similar tool that runs in e.g. Linux: autonum.sh in https://github.com/mobluse/ratbas2

And this too but in Perl for Unix and probably Linux:


There are also similar tools that runs in X16: 


 


 

X16&C64 Quiz: Try It Now! Huge Char Demo: Try It Now! DECPS: Try It Now! Aritm: Try It Now!
Johan Kårlin
Posts: 292
Joined: Wed Jun 03, 2020 11:33 am
Location: Kalmar, Sweden

New community dev tool uploaded: Basic Label Compiler for Windows

Post by Johan Kårlin »


Yes there are some developer tools that are more or less essential. You end upp making them yourselves or finding what someone else has already made. This is one example. I have made another tool - XPngConverter - for converting graphics, that's another. Good thing there's alternatives. A problem for all spare-time-developers is to really finish something. Perhaps can my contribution be making a (nearly) finished product which is quite polished. In this case I tried to succeed by keeping the list of features short. ?

Post Reply