One approach is to use a single-stepping circuit and toggle the bootstrap into RAM. This is historically authentic but error-prone and tedious!
If the SBC uses an EEPROM, it could be made to be programmable in-place(*), once you've got a way to get your code into the SBC.
Or, combining the two approaches, it would be possible to toggle the bootstrap into EEPROM, so you only need to get it right once.
But in any case the bootstrap should be short. I found myself wondering how short, and this is what I came up with - 27 bytes of utterly untested machine code!
Code: Select all
;; sketch of a minimal bootstrap
;; suitable to be toggled into an eeprom
;; loads up to 256 bytes, to be placed in zero page
;; this is minimal! no error checking!
;;
;; this bootstrap will load a bigger second-stage bootstrap from serial port
;; a typical second stage might load a monitor in srecord format
;;
.ORG $FFE5 ; (manually) place the bootstrap up against the reset vector (Edit: Nope! 2 bytes out!)
;; for info on 6850 see http://www.electronics.dit.ie/staff/tscarff/6800/6850acia/6850.htm
.DEFINE SERIAL_STATUS_REG $FE08
.DEFINE SERIAL_DATA_REG $FE09
.DEFINE EOF $EA ; NOP opcode to indicate end of program
; (must avoid this value even as a data byte)
bootstrap:
; master-reset the UART
LDA #$03
STA SERIAL_STATUS_REG
LDX #0
readbyte:
LDA SERIAL_STATUS_REG ; bit 0 tells us if there is a byte to read
ROR
BCC readbyte
LDA SERIAL_DATA_REG
CMP #EOF ; check for end of second stage
BEQ 65536 ; jump to second stage at bottom of zero page
STA 0,X
INX
BNE readbyte
.word bootstrap ; the 6502 reset vectorCode: Select all
FFE5 A9 03
FFE7 8D 08 FE
FFEA A2 00
FFEC AD 08 FE
FFEF 6A
FFF0 90 FA
FFF2 AD 09 FE
FFF5 C9 EA
FFF7 F0 07
FFF9 95 00
FFFB E8
FFFC D0 EE
FFFE E5 FF
(*) Edit: I think some EEPROMs are particularly easy to program, but I might be mistaken.