BASLOAD lets you write BASIC programs without line numbers in the editor of your choosing.
BASLOAD runs natively on the X16. As it's name implies, BASLOAD loads BASIC programs stored on the SD card into RAM. While loading a file, it's tokenized so that it can be run by the X16's built-in BASIC interpreter.
Source files are stored as plain text that can be edited in almost any editor on the X16 or on a modern computer. There are, however, special bindings for the text editor X16 Edit making the programming workflow more convenient.
Instructions on how to use BASLOAD and source code may be found here:
This is pretty handy! Although, I seem to have run in to a bug where it gets stuck loading forever. I stepped through the code and it looks like, with my file, the last character is 13, so it keeps reading that and treating it as EOL, but never reaching the EOF part of the code. I've attached it in case you're curious. It's basically just the three-line example you gave in the original post.
This is pretty handy! Although, I seem to have run in to a bug where it gets stuck loading forever. I stepped through the code and it looks like, with my file, the last character is 13, so it keeps reading that and treating it as EOL, but never reaching the EOF part of the code. I've attached it in case you're curious. It's basically just the three-line example you gave in the original post.
I also noticed that bug. I think I have fixed it in version 0.0.2 now available on the download page.
The 0.0.1 version did not call READST to test EOF condition if the last char was LF or CR. It seems that you get only one shot at reading the EOF condition. If you miss that and read one more character, you will never get an EOF.
Unless no more critical bugs are found, I will continue looking at performance issues. Without analyzing it a lot, I guess that the program's function to test for presence of a BASIC token is called a lot.
The label search already uses a checksum to speed up the search.
I think I could calculate the checksum of the tokens as well on program startup, and use these to speed up the token search.
Version 0.0.2 takes about 1 second to load a source file of 70 lines. That corresponds to 1,000 lines per 14.3 seconds. I'm sure it could be made to run a lot faster.
New community dev tool uploaded: BASLOAD
Posted: Tue Jul 13, 2021 5:04 am
by Stefan
I converted a small number guessing game to the source code format accepted by the BASLOAD tokenizer.
I've now got a test reimplementation of the token search function that uses a table of token metadata (lengths, checksums and pointers to start of token name).
This seems to have cut the time in half from version 0.0.2 at least for small programs, now using about 0.007 seconds per line of source code, corresponding to 7 seconds to load a source file of 1,000 lines.
Needs a bit of cleanup before publishing. Hopefully I find some time this weekend, but they are promising very nice weather where I live.
New community dev tool uploaded: BASLOAD
Posted: Fri Jul 16, 2021 5:05 pm
by Stefan
Version 0.0.3 now published. It contains:
performance improvements,
support for ON ... GOTO N1, N2, N3
support for labels after THEN without preceding GOTO/GOSUB
code cleanup
Please let me know if you use it and find bugs.
New community dev tool uploaded: BASLOAD
Posted: Sun Jul 25, 2021 8:56 am
by Stefan
Published version 0.0.5 just now.
This version adds support for BASIC source code in ISO mode lower case.
On reading the source file, ISO mode lower case text is converted to upper case. The content of strings is, however, left untouched. This should make it possible to program conveniently in ISO mode as well.
Apart from that a few bug fixes. The function that was reading the Kernal version number on startup was still not working properly in all circumstances, which caused some "random" loading failures.
Available in the download section, and on Github.
New community dev tool uploaded: BASLOAD
Posted: Sun Jul 25, 2021 8:20 pm
by mobluse
It says "support for ON ... GOTO N1, N2, N3", but does it also support "ON ... GOSUB N1, N2, N3"?
New community dev tool uploaded: BASLOAD
Posted: Mon Jul 26, 2021 4:01 am
by Stefan
7 hours ago, mobluse said:
It says "support for ON ... GOTO N1, N2, N3", but does it also support "ON ... GOSUB N1, N2, N3"?
Yes, it also supports the ON ... GOSUB N1, N2, ... construct.
New community dev tool uploaded: BASLOAD
Posted: Thu Jul 29, 2021 3:51 pm
by Stefan
Version 0.0.6 published now.
This version makes BASLOAD + X16 Edit = True.
As before, type SYS $9000 to load a BASIC source file. A new feature is that the program remembers the last loaded file, and you may select to reload that file without typing its name.
Another new feature is that you by typing SYS $9003 may load and start the text editor X16 Edit.
BASLOAD expects the X16 Edit executable to be stored in the root folder of the SD Card. The actual CBM DOS path is "//:X16EDIT*.PRG".
If BASLOAD has been used to load a BASIC source file, that file is automatically opened in the editor.
The purpose of these changes is to make the edit-save-load-test cycle more convenient.