2021-04-05 00:22:43 +00:00
|
|
|
*
|
|
|
|
* boot block.
|
|
|
|
*
|
|
|
|
* loaded at $0800
|
2021-04-05 01:42:52 +00:00
|
|
|
* relocates everything to $6000, loads extra blocks, and runs main.
|
2021-04-05 00:22:43 +00:00
|
|
|
|
|
|
|
xc
|
|
|
|
xc
|
|
|
|
rel
|
2021-04-05 01:42:52 +00:00
|
|
|
* org $0800
|
|
|
|
|
|
|
|
ORG equ $6000
|
2021-04-15 02:53:46 +00:00
|
|
|
*MAX_BLOCK equ 6
|
2021-04-05 01:42:52 +00:00
|
|
|
|
2021-04-05 00:22:43 +00:00
|
|
|
|
|
|
|
SLOT equ $00
|
|
|
|
CMD equ $42
|
|
|
|
UNIT equ $43
|
|
|
|
BUFFER equ $44
|
|
|
|
BLOCK equ $46
|
|
|
|
|
2021-04-05 01:42:52 +00:00
|
|
|
ext main
|
2021-04-15 02:53:46 +00:00
|
|
|
ext MAXBLOCKS
|
2021-04-05 00:22:43 +00:00
|
|
|
boot
|
|
|
|
mx %11
|
|
|
|
|
|
|
|
db $01 ; prodos boot id
|
|
|
|
|
|
|
|
* slot 5 = x = $50, a = $3178
|
|
|
|
* slot 6 = x = $60, a = $8401
|
|
|
|
* stx :unit
|
|
|
|
* txa
|
|
|
|
* lsr
|
|
|
|
* lsr
|
|
|
|
* lsr
|
|
|
|
* lsr
|
|
|
|
* ora #$c0
|
2021-04-05 01:42:52 +00:00
|
|
|
ldy #END-boot
|
|
|
|
:cp lda $0800,y ; boot,y
|
|
|
|
sta ORG,y
|
|
|
|
dey
|
|
|
|
bne :cp
|
|
|
|
jmp ORG+:entry-boot
|
|
|
|
|
|
|
|
:entry stx UNIT
|
2021-04-05 00:22:43 +00:00
|
|
|
txa
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
lsr
|
|
|
|
ora #$c0
|
|
|
|
sta :prodos+2
|
|
|
|
|
|
|
|
stz SLOT
|
|
|
|
sta SLOT+1
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
lda (SLOT),y
|
|
|
|
cmp #$20
|
|
|
|
bne noboot
|
|
|
|
ldy #3
|
|
|
|
lda (SLOT),y
|
|
|
|
bne noboot
|
|
|
|
ldy #5
|
|
|
|
lda (SLOT),y
|
|
|
|
cmp #$03
|
|
|
|
bne noboot
|
|
|
|
|
|
|
|
ldy #$ff
|
|
|
|
lda (SLOT),y
|
|
|
|
sta :prodos+1
|
|
|
|
|
|
|
|
|
2021-04-05 01:42:52 +00:00
|
|
|
lda #1 ; read block
|
2021-04-05 00:22:43 +00:00
|
|
|
sta CMD
|
|
|
|
sta BLOCK
|
|
|
|
stz BLOCK+1
|
|
|
|
stz BUFFER
|
2021-04-05 01:42:52 +00:00
|
|
|
lda #>{ORG+512} ; $0800+512
|
2021-04-05 00:22:43 +00:00
|
|
|
sta BUFFER+1
|
|
|
|
|
|
|
|
:read
|
|
|
|
jsr :prodos ; block 1
|
|
|
|
bcs noboot
|
|
|
|
|
|
|
|
inc BLOCK
|
|
|
|
inc BUFFER+1
|
|
|
|
inc BUFFER+1
|
|
|
|
lda BLOCK
|
2021-04-15 02:53:46 +00:00
|
|
|
cmp #MAXBLOCKS
|
2021-04-05 00:22:43 +00:00
|
|
|
bcc :read
|
|
|
|
bra :ok
|
|
|
|
|
|
|
|
:prodos jmp $0000
|
|
|
|
|
|
|
|
|
|
|
|
:ok
|
2021-04-05 01:42:52 +00:00
|
|
|
jmp main
|
2021-04-05 00:22:43 +00:00
|
|
|
|
|
|
|
noboot
|
2021-04-05 01:42:52 +00:00
|
|
|
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-*
|
2021-04-05 00:22:43 +00:00
|
|
|
|
|
|
|
sav boot.L
|