Micro BASIC for Apple-1 with 6800

5 posts / 0 new
Last post
Offline
Last seen: 4 hours 37 min ago
Joined: Apr 9 2024 - 02:24
Posts: 19
Micro BASIC for Apple-1 with 6800

In case anyone is interested, I've recently uploaded my port of Micro BASIC 1.3A for the Apple-1 with 6800 CPU to GitHub.

The build that I am presently using is located here. At this point, I have only ran it on an emulator.

As a Tiny BASIC dialect, it lacks some important features compared to Apple-1 BASIC, most notably:

  1. No string variables
  2. No CALL command
  3. No POKE, PEEK (or functions other than RND)

However, this is the only version of BASIC I've found for the 6800 with source available that is not under copyright.

Contributions are welcome. It looks like it would be fairly easy to add new commands such as CALL and POKE, but I haven't found time to dig into this. Adding string support would presumably be much more involved; this was apprantely done in later versions that appear to be under active copyright.

Offline
Last seen: 16 hours 19 min ago
Joined: May 4 2021 - 06:35
Posts: 172
Wow, that's amazing, thank

Wow, that's amazing, thank you for sharing!

I am going to spread the word among those I know implemented 6800 on their Replicas.

 

 

Let's see if we can have some test with Real Hardware!

 

Ciao!

Claudio - P-LAB

Offline
Last seen: 4 hours 37 min ago
Joined: Apr 9 2024 - 02:24
Posts: 19
Pushed some updates to the branch

Thanks Claudio!

I pushed some updates to the branch and generated a new prerelease here.

This includes addition of CALL and POKE commands like Apple-1 BASIC (the latter is only lightly tested).

Offline
Last seen: 4 hours 37 min ago
Joined: Apr 9 2024 - 02:24
Posts: 19
Pushed latest updates

FYI - I recently pushed these changes to the a1mon68 branch:

  • INPUT: Fixed error in handling of empty line.
  • Increased input buffer / max line length to 128.
  • Fixed off-by-one error in variable table indexing.
  • Added some code comments.

Latest build can be found here.

Offline
Last seen: 4 hours 37 min ago
Joined: Apr 9 2024 - 02:24
Posts: 19
Adventure demo

With a lot of coaching, I was able to teach Microsoft Copilot to generate code for this BASIC dialect.

One of the programs it generated is a simple adventure game. It's not very exciting to play, but it gives an idea of what can be done.

Its first draft was extremely broken, and it took many code review iterations to get it to generate a mostly bug-free program that would work without any modifications. It really wanted to use the colon syntax for multi-statement lines, and other BASIC features it heard about elsewhere, even though I provided it with the Micro-BASIC documentation and limitations up front. I had to tell it multiple times not to use these unsupported syntax features in the conversation. Another thing it frequently has problems with is moving lines around and forgetting to update the branch targets of the related GOTO/GOSUB statements.

It was interesting to see the constructs that it generated to work around the limitations of the language when it comes to control structures. For example, I had not considered chaining IF/THEN statements as a substitute for AND. Also, the IF/GO[TO,SUB] constructs (to work around lack of ELSE) are unnatural to me, as someone who mostly came up on structured programming in the 90's with languages like C/C++, though I believe this pattern was pretty common in these limited BASIC dialects.

Anyway, though sometimes annoying, it has proven useful as a tester to exercise the interpreter and expose issues that I may have missed. As one example, I hadn't run into the original 80-char line length limit in my own limited testing, but the long IF/THEN chains that it generated prompted me to investigate how to bump this up to match the 128-char limit of Apple's Integer BASIC.

Plain text iconAdventure.txt

Log in or register to post comments