A2osX/ProDOS.FX/ProDOS.S.ILDR.txt

235 lines
5.0 KiB
Plaintext
Raw Normal View History

2019-10-31 06:54:28 +00:00
NEW
AUTO 3,1
*--------------------------------------
2019-11-01 20:06:04 +00:00
ILDR.START jsr MLI check for file 'atinit'
2019-10-31 06:54:28 +00:00
.DA #MLIGETFILEINFO
.DA gfi_list
bcc gfi_ok branch if 'atinit' file found
2019-11-01 20:06:04 +00:00
2019-11-04 07:21:40 +00:00
cmp #MLI.E.FNOTFND
2019-12-02 07:09:58 +00:00
beq ILDR.SYSTEM if so, continue loading interpreter
2020-08-30 17:50:57 +00:00
ATINIT.KO jmp badatinit
2019-10-31 06:54:28 +00:00
gfi_ok lda gfi_type
cmp #$E2 is 'atinit' correct file type?
2019-12-02 07:09:58 +00:00
bne ATINIT.KO error - wrong file type
2019-11-04 07:21:40 +00:00
2019-10-31 06:54:28 +00:00
jsr MLI open 'atinit' file
2019-11-04 07:21:40 +00:00
.DA #MLIOPEN
2019-10-31 06:54:28 +00:00
.DA atopen
2019-12-02 07:09:58 +00:00
bne ATINIT.KO error
2019-10-31 06:54:28 +00:00
lda #$9F max size = 39.75k ($2000-$BF00)
sta rdlen+1
stz rdlen
2019-12-02 07:09:58 +00:00
2019-10-31 06:54:28 +00:00
jsr MLI read 'atinit' file to 'sysentry'
2019-11-04 07:21:40 +00:00
.DA #MLIREAD
2019-10-31 06:54:28 +00:00
.DA rdparm
2019-12-02 07:09:58 +00:00
bne ATINIT.KO error - too big
2019-10-31 06:54:28 +00:00
jsr MLI close 'atinit' file
2019-11-04 07:21:40 +00:00
.DA #MLICLOSE
2019-10-31 06:54:28 +00:00
.DA clparm
2019-12-02 07:09:58 +00:00
bne ATINIT.KO error
2019-10-31 06:54:28 +00:00
lda RROMBNK2 enable ROM
jsr sysentry execute ATinit
2019-11-04 07:21:40 +00:00
*--------------------------------------
ILDR.SYSTEM lda /dbuf search directory buffer
2019-10-31 06:54:28 +00:00
sta idxl+1
lda #$04 start 1 entry past header
bne H2434 always.
2019-11-04 07:21:40 +00:00
2019-10-31 06:54:28 +00:00
H2432 lda idxl calc next entry position
H2434 clc
adc dbuf+35 inc to next entry address
sta idxl
bcs H2451 branch if page cross.
adc dbuf+35 test for end of block.
bcc H2453 branch if not page cross
lda idxl+1
lsr end of block?
bcc H2453 no.
cmp #$09 end of directory?
bne H244D no.
jmp nointrp no interpreter, go quit.
2019-11-04 07:21:40 +00:00
2019-10-31 06:54:28 +00:00
H244D lda #$04 reset index to 1st entry in next block.
sta idxl
H2451 inc idxl+1 inc to next page.
H2453 ldy #$10 check file type.
lda #$FF must be a prodos sys file
eor (idxl),y
bne H2432 if not sys.
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
tay see if active
lda (idxl),y
beq H2432 if deleted file.
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
and #$0F strip file 'kind'.
sta pbuf save length of name.
cmp #$08 must be at least 'x.system'
bcc H2432 else, ignore it.
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
tay compare last 7 chars for '.system'
ldx #$06
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
H246C lda (idxl),y
eor iterp,x
2020-08-30 17:50:57 +00:00
asl ignore bit 7
2019-10-31 06:54:28 +00:00
bne H2432 branch if something else
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
dey
dex
bpl H246C
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
ldy #$00
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
H247A iny
lda (idxl),y
sta pbuf,y
cpy pbuf
bne H247A
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
jsr MLI open interpreter file
.DA #$C8
.DA opparm
bne badlod
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
jsr MLI get eof (length of file)
.DA #$D1
.DA efparm
bne badlod
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
lda eof+2
bne toolong
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
lda eof+1
cmp #$9F max size = 39.75k ($2000-$BF00)
bcs toolong
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
sta rdlen+1
lda eof
sta rdlen (read entire file)
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
jsr MLI read interpreter file
.DA #$CA
.DA rdparm
beq H24C8 go close if successfully read.
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
cmp #$56 memory conflict?
beq toolong then too large
bne badlod else, unable to load.
2020-08-30 17:50:57 +00:00
2019-10-31 06:54:28 +00:00
H24C8 jsr MLI close interpreter file
.DA #$CC
.DA clparm
bne badlod hopefully never taken
2019-11-05 07:29:49 +00:00
lda RROMBNK2 enable ROM
2020-08-30 17:50:57 +00:00
sta CLR80DISP
sta CLR80STORE
jsr init
jsr setvid
jsr setkbd
jsr home
2019-10-31 06:54:28 +00:00
jmp sysentry go run interpreter
nointrp jsr MLI no interpreter found,so quit.
.DA #$65
.DA quitparm
2020-08-30 17:50:57 +00:00
badatinit ldy #6
.1 lda atinitname,y
sta pbuf,y
2019-10-31 06:54:28 +00:00
dey
2020-08-30 17:50:57 +00:00
bpl .1
badlod ldx #ILDR.MSG.SYSLOADERR-ILDR.MSG
.HS 2C BIT ABS
2019-11-04 07:21:40 +00:00
2020-08-30 17:50:57 +00:00
toolong ldx #ILDR.MSG.SYSTOOLARG-ILDR.MSG
jsr ILDR.PrintX
2019-11-04 07:21:40 +00:00
2020-08-30 17:50:57 +00:00
ldy #0
.1 iny
lda pbuf,y
jsr COUT
cpy pbuf
bne .1
2019-11-04 07:21:40 +00:00
bra *
2019-12-02 07:09:58 +00:00
*--------------------------------------
2020-08-30 17:50:57 +00:00
ILDR.PrintX bit RROMBNK2
lda INVFLG
pha
jsr SETINV
.1 lda ILDR.MSG,x
pha
ora #$80
jsr COUT
inx
pla
bpl .1
lda #$A0
jsr COUT
pla
sta INVFLG
rts
*--------------------------------------
ILDR.MSG .EQ *
ILDR.MSG.SYSLOADERR .AT "Unable to load"
ILDR.MSG.SYSTOOLARG .AT "Too Large"
*--------------------------------------
2019-12-02 07:09:58 +00:00
gfi_list .DA #$0A
.DA atinitname
.HS 00
gfi_type .HS 00000000
.HS 0000000000000000
.HS 0000
2020-08-30 17:50:57 +00:00
*--------------------------------------
2019-12-02 07:09:58 +00:00
atopen .HS 03
.DA atinitname
.DA iobuf i/o buffer
.HS 01 ref# hard coded since no other files
2020-08-30 17:50:57 +00:00
*--------------------------------------
2019-12-02 07:09:58 +00:00
atinitname .DA #06 length of name
2020-08-30 17:50:57 +00:00
.AS "ATINIT" name of appletalk config file
2019-12-02 07:09:58 +00:00
*--------------------------------------
2019-10-31 06:54:28 +00:00
opparm .HS 03
.DA pbuf
.DA iobuf
.HS 01
efparm .HS 02
.DA #01
eof .HS 000000 length of file.
rdparm .HS 04
.HS 01
.DA sysentry
rdlen .HS 0000
.HS 0000
clparm .HS 01
.HS 00
quitparm .HS 04
.HS 00
.HS 0000
.HS 00
.HS 0000
2020-08-30 17:50:57 +00:00
iterp .AS ".SYSTEM" interpreter suffix that is required
2019-10-31 06:54:28 +00:00
*--------------------------------------
2019-11-01 20:06:04 +00:00
ILDR.LEN .EQ *-ILDR.START
2019-10-31 06:54:28 +00:00
MAN
2020-08-30 17:50:57 +00:00
SAVE usr/src/prodos.fx/prodos.s.ildr
LOAD usr/src/prodos.fx/prodos.s
2019-10-31 06:54:28 +00:00
ASM