Working bios added to rom

This commit is contained in:
Joppe Blondel
2026-10-07 14:24:45 +02:00
parent ae419aa2f5
commit 6a56786b86
7 changed files with 95 additions and 34 deletions
+17 -3
View File
@@ -1,5 +1,5 @@
#target bin
#include "memory.inc"
#include "build/memory.inc"
#include "hardware.inc"
#include "bios.inc"
@@ -15,7 +15,7 @@ UART_DATA .equ UART_BASE+001h
BUF_SIZE .equ 16
BUF_SIZE_MASK .equ 00fh
WORKSPACE .equ SHARED_MEM_START+01000h
WORKSPACE .equ SHARED_MEM_START+00400h
TX_HEAD .equ WORKSPACE+000h
TX_TAIL .equ WORKSPACE+001h
TX_COUNT .equ WORKSPACE+002h
@@ -34,15 +34,24 @@ RX_BUF .equ TX_BUF+BUF_SIZE
jp boot_copy
.org 00008h
boot_copy:
; copy bios to top 16k
di
; Make sure system reg is in its default state
; banking enabled
; bank 1 selected
ld a,BOOT_BANK_MAPPING
ld (SYSTEM_REGISTER),a
ld sp,BIOS_STACK_TOP
; copy bios to top 16k
ld hl,BIOS_ROM_START
ld de,SHARED_MEM_START
ld bc,BIOS_size
ldir
; copy basic to top 16k
ld hl,BASIC_ROM_START
ld de,BASIC_RAM_START
ld bc,BASIC_ROM_SIZE
ldir
jp init
#code BIOS, SHARED_MEM_START
@@ -115,6 +124,9 @@ init:
ld hl,msg_header
call puts
; Enter bios
jp BASIC_RAM_START
; Shouldnt come here
; just to be safe an endless loop
0$:
@@ -324,6 +336,7 @@ uart_kick:
; needs a (byte to tx)
; -------------------------------------------------------
putc:
push af
push de
push bc
push hl
@@ -363,6 +376,7 @@ putc:
pop hl
pop bc
pop de
pop af
ret
; -------------------------------------------------------