start working on boot code, move things around

This commit is contained in:
2024-11-21 10:40:59 -05:00
parent fc115752e6
commit dcc1bea405
15 changed files with 79 additions and 6 deletions

View File

@@ -1,5 +1,13 @@
# Code
## assist09/
assist09.asm is the original motorola version, and relies on the as9 assembler found [here](http://home.hccnet.nl/a.w.m.van.der.horst/m6809.html).
assemble.sh will assemble assist09.asm to an s19 file and use gnu binutils objcopy to turn that into a bin file.
## boot/
the boot code for prototype 1, uses the lwtools assembler.
assemble.sh will assemble boot.s to an s19 file and use gnu binutils objcopy to turn that into a bin file.

Binary file not shown.

View File

3
code/boot/assemble.sh Executable file
View File

@@ -0,0 +1,3 @@
lwasm --format=srec --output=boot.s19 boot.s
objcopy --input-target=srec --output-target=binary boot.s19 boot.bin
#mot2bin -out boot.bin boot.s19

BIN
code/boot/boot.bin Normal file

Binary file not shown.

3
code/boot/boot.ld Normal file
View File

@@ -0,0 +1,3 @@
section code load 8000
pad FFFF
section vectors load FFF0

44
code/boot/boot.s Normal file
View File

@@ -0,0 +1,44 @@
; CHIBI PC-09 Prototype #1 Boot ROM
; (Copyright (c) 2024 Amber Zeller
; UART registers
UART = $7F00
; When DLAB = 0
BUFR = UART ; TX/RX Buffer (Read for RX, Write for TX)
IER = UART + 1 ; Interrupt Enable Register
IIR = UART + 1 ; Interrupt Enable Register (Upon Read)
; When DLAB = 1
DLL = UART ; Divisor Latch (LSB)
DLM = UART + 1 ; Divisor Latch (MSB)
FCR = UART + 2 ; FIFO Control Register (Upon Write)
LCR = UART + 3 ; Line Control Register
MCR = UART + 4 ; MODEM Control Register
LSR = UART + 5 ; Line Status Register
MSR = UART + 6 ; MODEM Status Register
SCR = UART + 7 ; Scratch Register (Not for control just spare RAM)
; SECTION code
org $8000
RESET:
sta $cc
jmp RESET
fdb RESET
; ENDSECTION
; SECTION vectors
org $FFF0
; Reset/Interrupt Vectors
fdb $0000 ; Reserved
fdb $0000 ; SWI3
fdb $0000 ; SWI2
fdb $0000 ; FIRQ
fdb $0000 ; IRQ
fdb $0000 ; SWI
fdb $0000 ; NMI
fdb RESET ; Reset
; ENDSECTION

5
code/boot/boot.s19 Normal file
View File

@@ -0,0 +1,5 @@
S01800005B6C77746F6F6C7320342E32335D20626F6F742E73BF
S10A800097CC7E8000800094
S113FFF0000000000000000000000000000080007D
S5030002FA
S9030000FC

View File

@@ -0,0 +1,10 @@
# Dev environment
USE:
- [lwtools](http://www.lwtools.ca/)
- [f9dasm](https://github.com/Arakula/f9dasm)
lwtools uses lwasm
f9dasm uses f9dasm