A2osX/A2osX.S.QC.txt

295 lines
4.8 KiB
Plaintext
Raw Permalink Normal View History

2015-03-14 21:48:35 +00:00
NEW
2019-04-30 16:08:47 +00:00
AUTO 3,1
2015-03-14 21:48:35 +00:00
.LIST OFF
*--------------------------------------
* ****** START OF MLI QUIT CODE ******
2016-06-07 06:10:18 +00:00
* Load Address :$1000-$12FF
2015-03-14 21:48:35 +00:00
*--------------------------------------
.PH $1000
*--------------------------------------
2016-06-07 06:10:18 +00:00
* Kernel Stage 1
*--------------------------------------
2015-03-14 21:48:35 +00:00
A2osX.QC.Start .EQ *
A2osX.QC cld
2015-06-03 18:30:57 +00:00
jmp A2osX.QC.Start1
2020-09-25 12:05:23 +00:00
2021-03-17 19:49:39 +00:00
A2osX.QC.BOOT .BS 64
A2osX.QC.ROOT .BS 64
2020-09-25 12:05:23 +00:00
2015-06-03 18:30:57 +00:00
A2osX.QC.Start1 sei
ldx #$FF
txs
2022-03-13 12:52:24 +00:00
2015-06-03 18:30:57 +00:00
cli
2023-11-04 14:42:28 +00:00
bit IO.RROMBNK1
2015-03-14 21:48:35 +00:00
>LDYAI A2osX.QC
2023-11-04 14:42:28 +00:00
>STYA ROM.PWREDUP
jsr ROM.SETPWRC
2015-03-14 21:48:35 +00:00
lda #$01
2023-11-04 14:42:28 +00:00
sta GP.MEMTABL+$17 protect ProDOS MLI Page
ldx #$16
2020-09-25 12:05:23 +00:00
2023-11-04 14:42:28 +00:00
.1 stz GP.MEMTABL,x Reset ProDOS memory bitmap
2015-03-14 21:48:35 +00:00
dex
bne .1
2020-09-25 06:02:05 +00:00
2015-03-14 21:48:35 +00:00
lda #$CF protect zero page, stack and page 1
2023-11-04 14:42:28 +00:00
sta GP.MEMTABL
2018-11-30 16:00:36 +00:00
2015-03-14 21:48:35 +00:00
lda #$8C Reset 80 col screen ($0C=FF=HOME)
jsr $C300
2020-09-25 12:05:23 +00:00
2021-06-30 19:09:07 +00:00
ldx $280 some /PATH/.SYSTEM file passed ?
2020-09-25 12:05:23 +00:00
beq A2osX.QC.Start2
.2 dex
2021-05-22 21:05:12 +00:00
lda $280,x
cmp #'/'
bne .2
2021-06-30 19:09:07 +00:00
stx A2osX.QC.BOOT get /PATH/ in QC.BOOT...
2021-05-22 21:05:12 +00:00
.3 lda $280,x
sta A2osX.QC.BOOT,x
dex
bne .3
2021-06-30 19:09:07 +00:00
jsr A2osX.QC.SetPFX cd to QC.BOOT...
2021-05-22 21:05:12 +00:00
bcs A2osX.QC.Start2
2020-09-25 12:05:23 +00:00
jsr A2osX.QC.Load
bcs A2osX.QC.Start2
*--------------------------------------
* $2000 = JMP $xxxx
* $2003 = $EE
* $2004 = $EE
* $2005 = BufSize
* $2006 = PathLen
* $2007... Path
*--------------------------------------
2021-06-30 19:09:07 +00:00
lda $2000
cmp #$4C
bne .8
2021-06-30 19:09:07 +00:00
lda #$EE
cmp $2003
bne .8
2021-06-30 19:09:07 +00:00
cmp $2004
bne .8
ldy $280
iny
lda $280,y
beq .8
cmp $2005
bcs .8
sta $2006
ldx #0
.4 iny
lda $280,y
inx
sta $2006,x
cpx $2006
bne .4
2021-06-30 19:09:07 +00:00
.8 jmp $2000
2020-09-25 12:05:23 +00:00
A2osX.QC.Start2 sec
2018-07-12 15:20:39 +00:00
>LDYAI MSG.INIT1
2018-11-30 16:00:36 +00:00
jsr A2osX.QC.PrintYA
2019-12-09 15:53:14 +00:00
2021-05-22 21:05:12 +00:00
.3 jsr A2osX.QC.SetPFX
2015-03-14 21:48:35 +00:00
bcc .4
2019-12-09 15:53:14 +00:00
2018-07-12 15:20:39 +00:00
>LDYAI MSG.SETPREFIXKO
2019-12-09 15:53:14 +00:00
clc
2018-11-30 16:00:36 +00:00
jsr A2osX.QC.PrintYA
2019-04-30 16:08:47 +00:00
>LDYAI A2osX.QC.BOOT
sec
2018-11-30 16:00:36 +00:00
jsr A2osX.QC.PrintYA
2020-09-25 12:05:23 +00:00
>DEBUG
2015-03-14 21:48:35 +00:00
bra .3
2019-12-09 15:53:14 +00:00
2018-07-12 15:20:39 +00:00
.4 >LDYAI MSG.SETPREFIXOK
2019-12-09 15:53:14 +00:00
clc
jsr A2osX.QC.PrintYA
>LDYAI A2osX.QC.BOOT
2019-04-30 16:08:47 +00:00
sec
2018-11-30 16:00:36 +00:00
jsr A2osX.QC.PrintYA
2019-12-09 15:53:14 +00:00
2019-04-30 16:08:47 +00:00
ldx A2osX.QC.BOOT
stx $280 For appending SYS/KERNEL
2019-05-01 13:35:41 +00:00
2019-04-30 16:08:47 +00:00
stz $2C0,x
2019-12-09 15:53:14 +00:00
2019-04-30 16:08:47 +00:00
.5 lda A2osX.QC.BOOT,x
sta $280,x
sta $2C0-1,x BOOT sz for KERNEL
2019-04-30 16:08:47 +00:00
dex
bpl .5
ldx A2osX.QC.ROOT
stz $2E0,x
2020-09-25 12:05:23 +00:00
2019-04-30 16:08:47 +00:00
.6 lda A2osX.QC.ROOT,x
sta $2E0-1,x ROOT sz for KERNEL
dex
bpl .6
2023-11-12 13:20:15 +00:00
lda GP.KVER
cmp #$8D
beq .7
2019-05-01 13:35:41 +00:00
2023-11-12 13:20:15 +00:00
ldy #SYSKERNEL
lda /SYSKERNEL
bra .8
.7 ldy #SYSKRNL8M
lda /SYSKRNL8M
.8 sty TmpPtr1
sta TmpPtr1+1
2020-09-25 12:05:23 +00:00
ldx $280
ldy #0
2023-11-12 13:20:15 +00:00
.9 inx
2020-09-25 12:05:23 +00:00
iny
2023-11-12 13:20:15 +00:00
lda (TmpPtr1),y
2020-09-25 12:05:23 +00:00
sta $280,x
2023-11-12 13:20:15 +00:00
tya
cmp (TmpPtr1)
bne .9
2020-09-25 12:05:23 +00:00
stx $280
jsr A2osX.QC.Load
2019-05-01 13:35:41 +00:00
bcs *
2023-11-12 13:20:15 +00:00
>LDYAI MSG.INIT1OK
2019-04-30 16:08:47 +00:00
sec
2018-11-30 16:00:36 +00:00
jsr A2osX.QC.PrintYA
2015-06-03 18:30:57 +00:00
2023-11-12 13:20:15 +00:00
>DEBUGOA
2016-06-07 06:10:18 +00:00
jmp $2000
*--------------------------------------
2021-05-22 21:05:12 +00:00
A2osX.QC.SetPFX jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.SETPREFIX
2021-05-22 21:05:12 +00:00
.DA MLISETPREFIX03
rts
*--------------------------------------
2020-09-25 12:05:23 +00:00
A2osX.QC.Load >LDYAI MSG.LOAD
2019-04-30 16:08:47 +00:00
clc
2018-11-30 16:00:36 +00:00
jsr A2osX.QC.PrintYA
2020-09-25 12:05:23 +00:00
>LDYAI $280
clc
jsr A2osX.QC.PrintYA
2015-03-14 21:48:35 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.OPEN
2020-09-25 12:05:23 +00:00
.DA MLIOPEN03
2015-03-14 21:48:35 +00:00
bcs .9
2020-09-25 12:05:23 +00:00
lda MLIOPEN03+5
sta MLIREAD03+1
sta MLICLOSE03+1
2015-03-14 21:48:35 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.READ
2020-09-25 12:05:23 +00:00
.DA MLIREAD03
php
pha
2015-03-14 21:48:35 +00:00
jsr MLI
2023-11-04 14:42:28 +00:00
.DA #MLI.CLOSE
2020-09-25 12:05:23 +00:00
.DA MLICLOSE03
2015-03-14 21:48:35 +00:00
pla
plp
2018-11-30 07:42:49 +00:00
bcc .8
2019-12-09 15:53:14 +00:00
2020-09-25 12:05:23 +00:00
.9 pha
>LDYAI MSG.LOAD.KO
clc
2018-11-30 16:00:36 +00:00
jsr A2osX.QC.PrintYA
2020-09-25 12:05:23 +00:00
pla
2023-11-04 14:42:28 +00:00
jsr ROM.PRBYTE
jsr ROM.CROUT
2020-09-25 12:05:23 +00:00
2019-04-30 16:08:47 +00:00
sec
2019-12-09 15:53:14 +00:00
rts
2020-09-25 12:05:23 +00:00
.8 >LDYAI MSG.LOAD.OK
2019-12-09 15:53:14 +00:00
sec
jsr A2osX.QC.PrintYA
clc
rts
2015-03-14 21:48:35 +00:00
*--------------------------------------
2018-11-30 16:00:36 +00:00
A2osX.QC.PrintYA
2019-04-30 16:08:47 +00:00
php
2018-11-30 16:00:36 +00:00
>STYA TmpPtr1
2015-03-14 21:48:35 +00:00
lda (TmpPtr1)
tax
beq .9
2018-11-30 16:00:36 +00:00
2015-03-14 21:48:35 +00:00
ldy #1
2021-03-17 19:49:39 +00:00
2015-03-14 21:48:35 +00:00
.1 lda (TmpPtr1),y
ora #$80
2023-11-04 14:42:28 +00:00
jsr ROM.COUT
2015-03-14 21:48:35 +00:00
iny
dex
bne .1
2019-11-27 22:04:55 +00:00
2019-04-30 16:08:47 +00:00
.9 plp
bcc .99
2021-03-17 19:49:39 +00:00
2023-11-04 14:42:28 +00:00
jsr ROM.CROUT
2021-03-17 19:49:39 +00:00
2019-10-03 06:25:27 +00:00
.99 rts
2015-03-14 21:48:35 +00:00
*--------------------------------------
2020-09-25 12:05:23 +00:00
MLISETPREFIX03 .DA #1
2019-04-30 16:08:47 +00:00
.DA A2osX.QC.BOOT
*--------------------------------------
2020-09-25 12:05:23 +00:00
MLIOPEN03 .DA #3
2019-04-30 16:08:47 +00:00
.DA $280
.DA $C00
2015-03-14 21:48:35 +00:00
.BS 1
*--------------------------------------
2020-09-25 12:05:23 +00:00
MLIREAD03 .DA #4
2015-03-14 21:48:35 +00:00
.BS 1
.DA $2000
2020-09-25 12:05:23 +00:00
.DA $9F00 Max .SYSTEM file len
2015-03-14 21:48:35 +00:00
.BS 2
*--------------------------------------
2020-09-25 12:05:23 +00:00
MLICLOSE03 .DA #1
2015-03-14 21:48:35 +00:00
.BS 1
*--------------------------------------
SYSKERNEL .PS "sys/kernel"
2023-11-12 13:20:15 +00:00
SYSKRNL8M .PS "sys/krnl8m"
2015-03-14 21:48:35 +00:00
*--------------------------------------
MSG.INIT1 .PS "A2osX[Stage1]:Init"
MSG.SETPREFIXOK .PS "Prefix Set: "
MSG.SETPREFIXKO .PS "Insert Vol:"
MSG.LOAD .PS "Loading : "
MSG.LOAD.KO .PS " Error $"
MSG.LOAD.OK .PS " OK."
MSG.INIT1OK .PS "A2osX[Stage1]:Complete."
2015-03-14 21:48:35 +00:00
*--------------------------------------
2020-09-25 06:02:05 +00:00
.LIST ON
QC.FREE .EQ $1300-*
.LIST OFF
2015-03-14 21:48:35 +00:00
.EP
*--------------------------------------
MAN
2022-03-13 12:52:24 +00:00
SAVE usr/src/a2osx.s.qc
LOAD usr/src/a2osx.s
2015-03-14 21:48:35 +00:00
ASM