One reason for choosing the BBC Micro as a platform is that it has spare sockets for extra ROMs and convenient OS mechanisms for bringing extra code into play. Another reason is that it has a serial port and the OS allows redirection of input and output- so we can easily hook the Beeb up to a Linux or Mac computer and drive it from the command line (or even allow ssh access from elsewhere)
But to use the serial port as the primary i/o channel, you need to perform a few OS calls. We wrote a small utility ROM which by default performs the serial redirect at boot time. It also contains a few simple test routines for the extended memory space of the 65816, and most recently we addded an Srecord loader so we could more easily test new code.
We did some testing of the ROM code on emulators: run6502 and run65816, and Rich could use ROMBO to test and then burn updates. (Now the code has grown beyond 2k we can no longer test using ROMBO - there is scope for cutting the code down again, as there always is.)
Here's the ROM responding to the HELP command:
>*HELPBOOT816 $Rev: 278 $OS 1.20>*HELP BOOT816BOOT816 ROM - new * commands BIST20 HITESTHIMEM HITEST2 REPORTCPU REPORTHIMEM SETSERIALREDIRECT TEST816 TESTHIMEM IRQINSTALL HIPEEK HIPOKEOS 1.20>A makefile is a handy way to automate a sequence of commands which take some original format - like assembly code - and produce another - like a binary ROM image, or an srecord file. Here's one of ours:
BASE ?= 0x8000
all: boot816.bin irqhandler.srec
clean:
rm -f *.o *.lst *.srec *.bin
%.o : %.as
ca65 -l $< -D BASE=$(BASE)
%.bin: %.o
cl65 $< --target none --start-addr $(BASE) -o $@
%.srec: %.bin
srec_cat $< > $@ -Binary -offset $(BASE) -crlf -data-only
which results in command sequences like these:
ca65 -l boot816.as -D BASE=0x8000cl65 boot816.o --target none --start-addr 0x8000 -o boot816.binsrec_cat boot816.bin > boot816.srec -Binary -offset 0x8000 -crlf -data-onlyfrom simple invocations like these:
make boot816.srecmake srecord.srec BASE=0x2000