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

203 lines
4.8 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-10-31 06:54:28 +00:00
beq H23DF if so, continue loading interpreter
bne H23E2
2019-11-04 07:21:40 +00:00
2019-10-31 06:54:28 +00:00
gfi_ok lda gfi_type
cmp #$E2 is 'atinit' correct file type?
bne H23E2 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
bne H23E2 error
lda #$9F max size = 39.75k ($2000-$BF00)
sta rdlen+1
stz rdlen
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
bne H23E2 error - too big
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
bne H23E2 error
lda RROMBNK2 enable ROM
jsr sysentry execute ATinit
2019-11-04 07:21:40 +00:00
H23DF jmp ILDR.SYSTEM execute .system file
2019-11-04 20:42:38 +00:00
*--------------------------------------
2019-11-04 07:21:40 +00:00
H23E2 ldx ATINIT.ERR
H23E5 lda ATINIT.ERR,x
2019-10-31 06:54:28 +00:00
sta vline16,x
dex
bne H23E5
beq *
ATINIT.ERR .DA #$1A length of message
.AS -"Unable to load ATInit file"
gfi_list .DA #$0A
.DA atinitname
.HS 00
gfi_type .HS 00000000
.HS 0000000000000000
.HS 0000
atopen .HS 03
.DA atinitname
.DA iobuf i/o buffer
.HS 01 ref# hard coded since no other files
atinitname .DA #06 length of name
.AS -"atinit" name of appletalk config file
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.
tay see if active
lda (idxl),y
beq H2432 if deleted file.
and #$0F strip file 'kind'.
sta pbuf save length of name.
cmp #$08 must be at least 'x.system'
bcc H2432 else, ignore it.
tay compare last 7 chars for '.system'
ldx #$06
H246C lda (idxl),y
eor iterp,x
asl
bne H2432 branch if something else
dey
dex
bpl H246C
ldy #$00
H247A iny
lda (idxl),y
sta pbuf,y
ora #$80 msb on so can be displayed if error
sta iomess+$11,y
cpy pbuf
bne H247A
lda #$A0 space after name
sta iomess+$12,y
tya error message length
adc #$13 (carry set)
sta ierlen
jsr MLI open interpreter file
.DA #$C8
.DA opparm
bne badlod
jsr MLI get eof (length of file)
.DA #$D1
.DA efparm
bne badlod
lda eof+2
bne toolong
lda eof+1
cmp #$9F max size = 39.75k ($2000-$BF00)
bcs toolong
sta rdlen+1
lda eof
sta rdlen (read entire file)
jsr MLI read interpreter file
.DA #$CA
.DA rdparm
beq H24C8 go close if successfully read.
cmp #$56 memory conflict?
beq toolong then too large
bne badlod else, unable to load.
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
2019-11-04 07:21:40 +00:00
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
badlod ldy ierlen center the error message
lda #$27
sec
sbc ierlen
lsr
adc ierlen
tax
H24FA lda iomess,y
sta vline16,x
dex
dey
bpl H24FA
2019-11-04 07:21:40 +00:00
bra *
2019-10-31 06:54:28 +00:00
toolong ldy #$1E
2019-11-04 07:21:40 +00:00
2019-10-31 06:54:28 +00:00
H2508 lda lgmess,y
sta vline16+5,y
dey
bpl H2508
2019-11-04 07:21:40 +00:00
bra *
2019-10-31 06:54:28 +00:00
lgmess .AS -"** System program too large **"
iomess .AS -"** Unable to load"
.AS -" X.System *********"
ierlen .HS 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
iterp .AS -".SYSTEM" interpreter suffix that is required
*--------------------------------------
2019-11-01 20:06:04 +00:00
ILDR.LEN .EQ *-ILDR.START
2019-10-31 06:54:28 +00:00
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.ILDR
LOAD USR/SRC/PRODOS.FX/PRODOS.S
ASM