Re: 65C02 Version of EhBasic
Posted: Sun May 24, 2020 2:58 am
I'm finally getting around to some additional coding on my C02Monitor. I'm adding a simple assembler to compliment the disassembler. It will support all instructions and addressing modes of the WDC W65C02S CPU, so stuff like WAI, STP, SMBx, RMBx, BBSx, BBRx will also be in there. BTW - I don't have any set time frame for completing this.... but it's at least a work in progress.
However, I also wanted/needed to free up some additional ROM space as I'm trying to ensure that the Monitor stays within 6KB (6144 bytes). So... some minor changes to my CMOS version of Enhanced Basic was needed. The attached version requires a minimum of two BIOS functions; character in and character out. Beyond these, everything to Cold/Warm Start and run EhBasic is contained in the single source file. Additional ROM routines can be declared for LOAD, SAVE and EXIT. The LOAD and SAVE routines use the Xmodem-CRC support in my C02Monitor code. The code in Basic sets up all of the variables for the Xmodem transfer, then calls the Monitor code to transfer the data. EXIT simply calls the warm start vector for the Monitor. The required ROM routines are declared starting at line 529 in the source file.
There's a few extra updates in the code that shave some execution time from the previous version. The assembled and linked code is 10,126 bytes, so it's still less than 10KB (10240 bytes). I don't see me needing to add anything else to this code drop, unless Klaus finds and fixes some additional bugs in his maintained 2.22p5 version. Be aware however, that this version does use several of the newer CMOS instructions and address modes. These include instructions like SMBx, RMBx, BBSx, BBRx, so this will NOT run on a W65C816 in emulation mode.
For anyone using my recent CMOS version, I would recommend switching to this one. For anyone else interested in getting EhBasic working on their system, this version is likely going to be easier to integrate into any existing working system, as the separate monitor from the original is not required. Of course, this implies that you're using a 65C02 from WDC or Rockwell. Note that I've not tested on a Rockwell R65C02, only on the WDC CPU.
However, I also wanted/needed to free up some additional ROM space as I'm trying to ensure that the Monitor stays within 6KB (6144 bytes). So... some minor changes to my CMOS version of Enhanced Basic was needed. The attached version requires a minimum of two BIOS functions; character in and character out. Beyond these, everything to Cold/Warm Start and run EhBasic is contained in the single source file. Additional ROM routines can be declared for LOAD, SAVE and EXIT. The LOAD and SAVE routines use the Xmodem-CRC support in my C02Monitor code. The code in Basic sets up all of the variables for the Xmodem transfer, then calls the Monitor code to transfer the data. EXIT simply calls the warm start vector for the Monitor. The required ROM routines are declared starting at line 529 in the source file.
There's a few extra updates in the code that shave some execution time from the previous version. The assembled and linked code is 10,126 bytes, so it's still less than 10KB (10240 bytes). I don't see me needing to add anything else to this code drop, unless Klaus finds and fixes some additional bugs in his maintained 2.22p5 version. Be aware however, that this version does use several of the newer CMOS instructions and address modes. These include instructions like SMBx, RMBx, BBSx, BBRx, so this will NOT run on a W65C816 in emulation mode.
For anyone using my recent CMOS version, I would recommend switching to this one. For anyone else interested in getting EhBasic working on their system, this version is likely going to be easier to integrate into any existing working system, as the separate monitor from the original is not required. Of course, this implies that you're using a 65C02 from WDC or Rockwell. Note that I've not tested on a Rockwell R65C02, only on the WDC CPU.