Sunday, August 20, 2017

68hc11 BASIC

This morning I made a preliminary pass through the Microcolor BASIC derived source code to come up with an abridged list of changes from the 6803 version.  This skips over the sub tasks for each line item.
  1. Remove cassette support. 
  2. Remove sound support.
  3. Remove graphics functions
  4. Remove MC-10 hardware from the memory map
  5. Remove 6803 hardware definitions from the memory map
  6. Add 68hc11 hardware definitions and reserve space in the memory map
  7. Add the setup and serial I/O functions to interface with a terminal.
  8. Change CLS to work with serial I/O for a terminal.
  9. Add a BELL command to beep the terminal
  10. Change all printed output to be via terminal
  11. Change all input to be via terminal
  12. Move ELSE command up in the keyword and token tables, remove patches related to ELSE
  13. Change memory moves to use Y instead of the stack pointer
  14. Add code that saves the pointer to the next line
  15. Update divide function to use hardware instructions
  16. Replace SQR function with optimized version
  17. Update multiply with 16 bit multiply instructions

The first five are almost complete.  Some pieces of code will be needed once new hardware is added, but I can cut and past from the original 6803 code when the time comes.

The terminal I/O will require the most work unless I can locate a disassembly of the 6800 version.  I suppose I could do it myself but it's probably faster to just implement from scratch.

There are several things I may work on before finishing the last few items on that list.
The cruncher could use a little work.  It could automatically remove extra spaces, and the fix of inserting a colon before the else doesn't check if there is already a colon in the source code.
PRINT USING would make a nice addition.  There are also a few bugs in the ROM that have never been addressed.  And this BASIC could use a line editor at some point.
That may be secondary to adding a file system for an IDE interface.  I/O is actually much simpler than for cassette, but cassette doesn't have to maintain any kind of directory structure.  It may make more sense for support to be more like IDE interfaces on the TRS-80 Model I than the FAT file system from the PC.

A 68hc12 build should be possible once the first 11 steps are finished.  Code optimizations that take advantage of it's new features could be added later.

No comments:

Post a Comment