All, I've been working part-time on getting a simple BIOS working which will support some basic functions with a 6551 and 6522. It's quite small but also very flexible and extensible using page $03 for vector data and config data. It also provides a JMP table with 40 entries (16 used by BIOS) located at $FF00. It fits neatly into the top 1024 bytes which also includes the I/O page at ($FE00), so only 768 bytes are used, which includes 120 bytes for the JMP table, 64 bytes for vector / config data and another 17 bytes for a BIOS message. Note that there are extra Vector inserts available and 16 bytes of free config data.
As some folks get started on building an initial 65C02 system, this may be useful and get a head start of sorts. It's also heavily commented so should be quite easy to understand and modify as required. Note that it only runs with a 65C02 and will not run on an older 6502 base processor. It's also recommended that you use at least a 2MHz CPU as the interrupts can exceed 5000 per second. Note that I have a 65C51 running with a double-rate baud clock, so it's running at 38.4K. I've also got a system running at 10MHz with the BIOS and a Monitor program which is still a work in progress. Enjoy
Table data is provided for clock rates of: 2, 4, 5, 6, 8, 10, 12, 16MHz which are used for timer setup. The basic functions provided are:
;******************************************************************************
; The following 16 functions are provided by BIOS and available via the JMP
; Table as the last 16 entries from $FF48 - $FF75 as:
; $FF48 BEEP (send audible beep to console)
; $FF4B CHRIN (character input from console)
; $FF4E CHROUT (character output to console)
; $FF51 SETDLY (set delay value for milliseconds and 16-bit counter)
; $FF54 MSDELAY (execute millisecond delay 1-256 milliseconds)
; $FF57 LGDELAY (execute long delay; millisecond delay * 16-bit count)
; $FF5A XLDELAY (execute extra long delay; 8-bit count * long delay)
; $FF5D SETPORT (set VIA port A or B for input or output)
; $FF60 RDPORT (read from VIA port A or B)
; $FF63 WRPORT (write to VIA port A or B)
; $FF66 INITVEC (initialize soft vectors at $0300 from ROM $FDC0)
; $FF69 INITCFG (initialize soft config values at $0320 from ROM $FDE0)
; $FF6C INITCON (initialize 6551 console 19.2K, 8-N-1 RTS/CTS)
; $FF6F INITVIA (initialize 6522 default port, timers and interrupts)
; $FF72 MONWARM (warm start Monitor - jumps to page $03)
; $FF75 MONCOLD (cold start Monitor - jumps to page $03)
;******************************************************************************
Attachment:
C02BIOS.asm [34.43 KiB]
Downloaded 216 times