Recently I've been playing with the EEPROM on the Replica 1 Multi I/O board. The other day I built my JMON monitor program to run out of it. It just needed to have the link address changed to $A000. It was nice to see that it worked out of ROM without any code changes.
Today I rebuilt the Applesoft Lite BASIC interpreter to run out of the Multi I/O EEPROM socket. I downloaded the source code and just made some changes to a couple of files.
By default it builds at address $E000 so it can replace the the on-board EPROM and includes the Woz monitor at $FE00. I didn't need to include the Woz monitor so I removed it from the list of objects to link. Here is the diff to the Makefile:
% diff Makefile.orig Makefile
< OBJS = applesoft-lite.o io.o cffa1.o wozmon.o
> OBJS = applesoft-lite.o io.o cffa1.o
It needs to be linked starting at address $A000 rather than $E000, so I made these changes to
the file replica1.cfg, as well as removing the Woz monitor code:
% diff replica1.cfg.orig replica1.cfg
< BASROM: start = $E000, size = $1F00, fill = yes, file = %O;
< MONROM: start = $FF00, size = $100, fill = yes, file = %O;
> BASROM: start = $A000, size = $1FFF, fill = yes, file = %O;
> # MONROM: start = $FF00, size = $100, fill = yes, file = %O;
< MONITOR: load = MONROM, type = ro;
> # MONITOR: load = MONROM, type = ro;
With that it built and worked like a charm. I can now load Applesoft Lite at any time with an "A000R" command from the Woz monitor.
|Applesoft Lite running from EEPROM|
I made an enhanced version of this program that adds a few features. Specifically:
- You can optionally get the start address from the binary file (which seems to be the case when building a C program but not when building an assembler program).
- You can specify the load address on the command line.
- You can optionally specify the run address on the command line (when it differs from the load address)
- Support for standard command line option parsing.
- A verbose option that displays information about the file.
The command usage is:
bintomon [-v] [-f] [-l LoadAddress] [-r RunAddress] filename
To generate the download file for Applesoft Lite I used:
bintomon -l 0xa000 applesoft-lite.bin >applesoft-lite.txt
In a future blog posting I will talk more about the CC65 assembler package and how to use the accompanying C compiler with the Replica 1.