start of tape loading. hw works and have a generation script

This commit is contained in:
Joppe Blondel
2026-10-03 16:29:41 +02:00
parent 47fffc2e71
commit 5897e55094
16 changed files with 784 additions and 106 deletions
+50
View File
@@ -0,0 +1,50 @@
.include "bios.inc"
.area TAPELOAD (ABS)
.org TAPE_LOADER_ROM_ADDRESS
COMP_PORT = 0x18
WORK_BASE = 0x0B000
LOAD_START = 0x08000
LOAD_LIMIT_HI = 0x0B0
STACK_TOP = 0x0BFFF
OLD_SP = WORK_BASE+0x00
start:
ld (OLD_SP), sp
ld sp, #STACK_TOP
di
poll_loop:
; Read from the hardware port COMP_PORT
in a, (COMP_PORT)
out (COMP_PORT), a
; Save the raw port status in register B
ld b, a
; Print a carriage return '\r' (ASCII 0x0D)
ld a, #0x0D
call BIOS_PUTC
; Restore the port status and isolate the relevant bit
; (Assuming bit 0 determines 0 or 1; adjust 'and' mask if it is a different bit)
ld a, b
and #0x01
; Convert the binary 0 or 1 into ASCII '0' (0x30) or '1' (0x31)
add a, #0x30
; Print the '0' or '1' character
call BIOS_PUTC
; Infinite loop: poll continuously
jr poll_loop
ld sp, (OLD_SP)
ei
ret