From 02acf18c04431735d390f9a5a80a0cfae7820664 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 4 Apr 2021 21:42:52 -0400 Subject: [PATCH] move code to $6000 since $0800 interferes w/ text page 2. --- boot.S | 42 +++++++++++++++++++++++++++++------------- link.S | 2 +- vt52.S | 14 +++++++++++++- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/boot.S b/boot.S index 83e87e2..df609f0 100644 --- a/boot.S +++ b/boot.S @@ -2,10 +2,15 @@ * boot block. * * loaded at $0800 +* relocates everything to $6000, loads extra blocks, and runs main. xc xc rel +* org $0800 + +ORG equ $6000 + SLOT equ $00 CMD equ $42 @@ -13,7 +18,7 @@ UNIT equ $43 BUFFER equ $44 BLOCK equ $46 - ext init + ext main boot mx %11 @@ -28,9 +33,14 @@ boot * lsr * lsr * ora #$c0 + ldy #END-boot +:cp lda $0800,y ; boot,y + sta ORG,y + dey + bne :cp + jmp ORG+:entry-boot - - stx UNIT +:entry stx UNIT txa lsr lsr @@ -59,12 +69,12 @@ boot sta :prodos+1 - lda #1 + lda #1 ; read block sta CMD sta BLOCK stz BLOCK+1 stz BUFFER - lda #$a0 ; $0800+512 + lda #>{ORG+512} ; $0800+512 sta BUFFER+1 :read @@ -83,18 +93,24 @@ boot :ok - - clc - xce - cli - - jsr init + jmp main noboot -:loop wai - bra :loop + ldx #0 +:cout lda :str,x + beq :wai + jsr $fded + inx + bra :cout +:wai wai + bra :wai +:str asc "** BOOT ERROR **",00 +END + err *-boot>$ff +* fill to end of block since only 255 bytes relocated. + ds boot+512-* sav boot.L \ No newline at end of file diff --git a/link.S b/link.S index 30352d0..d89a42c 100644 --- a/link.S +++ b/link.S @@ -1,7 +1,7 @@ * binary link lkv 0 - org $0800 + org $6000 ovr all * if boot.S diff --git a/vt52.S b/vt52.S index 1db2fb9..51fa10b 100644 --- a/vt52.S +++ b/vt52.S @@ -1,4 +1,5 @@ lst off + exp off xc xc rel @@ -16,7 +17,7 @@ SETALTCHAR equ $c00f TXTSET equ $c051 - ent init + ent init,main dum 0 @@ -36,6 +37,17 @@ cursor_state dw 0 dend +main + clc + xce + cli + + jsr init + +:loop wai + bra :loop + + init sep #$30 sta TXTSET