mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 07:54:37 +00:00
183 lines
3.4 KiB
Plaintext
183 lines
3.4 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF BIN/LSDEV
|
||
*--------------------------------------
|
||
.INB INC/MACROS.I
|
||
.INB INC/PRODOS.I
|
||
.INB INC/A2OSX.I
|
||
*--------------------------------------
|
||
ZPPTR1 .EQ ZPBIN
|
||
ZPPTR2 .EQ ZPBIN+2
|
||
*--------------------------------------
|
||
* File Header (16 Bytes)
|
||
*--------------------------------------
|
||
CS.START cld
|
||
jmp (.1,x)
|
||
.DA #$61 6502,Level 1 (65c02)
|
||
.DA #1 BIN Layout Version 1
|
||
.DA 0
|
||
.DA CS.END-CS.START CS
|
||
.DA DS.END-DS.START DS
|
||
.DA #16 SS
|
||
.DA #4 ZP
|
||
.DA 0
|
||
*--------------------------------------
|
||
* Relocation Table
|
||
*--------------------------------------
|
||
.1 .DA CS.INIT
|
||
.DA CS.RUN
|
||
.DA CS.EVENT
|
||
.DA CS.QUIT
|
||
L.MSG0 .DA MSG0
|
||
L.MSG1 .DA MSG1
|
||
L.MSG2 .DA MSG2
|
||
L.MSG2.C .DA MSG2.C
|
||
L.MSG2.B .DA MSG2.B
|
||
.DA 0
|
||
*--------------------------------------
|
||
CS.INIT clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.RUN >LDYA L.MSG0
|
||
>SYSCALL puts
|
||
|
||
>LDA.G DEV.ID
|
||
|
||
.1 >SYSCALL GetDevByID
|
||
bcs .7
|
||
|
||
>STYA ZPPTR1 S.FD
|
||
txa
|
||
>STA.G DEV.FD
|
||
|
||
jsr DumpFD
|
||
|
||
bcs .9
|
||
|
||
>PUSHEA.G DEV.DIB
|
||
>LDA.G DEV.FD
|
||
>SYSCALL GetDevStatus
|
||
bcs .6
|
||
|
||
jsr DumpDIB
|
||
|
||
bcs .9
|
||
|
||
.6 lda #13
|
||
>SYSCALL PutChar
|
||
lda #10
|
||
>SYSCALL PutChar
|
||
|
||
.7 >INC.G DEV.ID
|
||
cmp #K.DEV.MAX
|
||
bne .1
|
||
|
||
.8 lda #0 tell TSKMGR that all done ok, but
|
||
sec we do not want to stay in memory
|
||
.9 rts
|
||
*--------------------------------------
|
||
DumpFD ldy #S.FD.DEV.DRVPTR+1
|
||
>PUSHB (ZPPTR1),y
|
||
|
||
dey
|
||
>PUSHB (ZPPTR1),y
|
||
|
||
lda #S.FD.DEV.NAME
|
||
clc
|
||
adc ZPPTR1
|
||
tay
|
||
|
||
lda /S.FD.DEV.NAME
|
||
adc ZPPTR1+1
|
||
>PUSHYA
|
||
|
||
>PUSHB.G DEV.ID
|
||
|
||
>PUSHBI 5
|
||
>LDYA L.MSG1
|
||
>SYSCALL printf
|
||
rts
|
||
*--------------------------------------
|
||
DumpDIB >PUSHB.G DEV.DIB+S.DIB.VERSION+1
|
||
>PUSHB.G DEV.DIB+S.DIB.VERSION
|
||
|
||
>PUSHEA.G DEV.DIB+S.DIB.IDS
|
||
|
||
>PUSHB.G DEV.DIB+S.DIB.ST
|
||
>PUSHB.G DEV.DIB+S.DIB.T
|
||
|
||
>LDA.G DEV.DIB+S.DIB.S
|
||
|
||
ldy #DEV.SFLAGS+7
|
||
ldx #7
|
||
|
||
.1 lsr
|
||
pha
|
||
lda #'-'
|
||
bcc .2
|
||
|
||
lda MSG.SFLAGS,x
|
||
|
||
.2 sta (pData),y
|
||
pla
|
||
dey
|
||
dex
|
||
bpl .1
|
||
|
||
>PUSHEA.G DEV.SFLAGS
|
||
>PUSHBI 8
|
||
>LDYA L.MSG2
|
||
>SYSCALL printf
|
||
bcs .9
|
||
|
||
>LDA.G DEV.DIB+S.DIB.S
|
||
bpl .4 char device...
|
||
|
||
>PUSHBI 0
|
||
|
||
>PUSHB.G DEV.DIB+S.DIB.SIZE+2
|
||
>PUSHB.G DEV.DIB+S.DIB.SIZE+1
|
||
>PUSHB.G DEV.DIB+S.DIB.SIZE
|
||
|
||
>PUSHBI 4
|
||
>LDYA L.MSG2.B
|
||
bra .8
|
||
|
||
.4 >PUSHBI 0
|
||
>LDYA L.MSG2.C
|
||
|
||
.8 >SYSCALL printf
|
||
.9 rts
|
||
*--------------------------------------
|
||
CS.EVENT sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.QUIT clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.END
|
||
MSG0 .AZ "ID Name Addr. Status Typ/Sub IDString Version Size (BLK)"
|
||
MSG1 .AZ "%03d %7s $%H "
|
||
MSG2 .AZ "%s $%h/$%h %16S %03d.%03d "
|
||
MSG2.B .AZ "%10u"
|
||
MSG2.C .AZ "n/a"
|
||
MSG.SFLAGS .AS "BWRLNEIO"
|
||
*--------------------------------------
|
||
.DUMMY
|
||
.OR 0
|
||
DS.START
|
||
DEV.ID .BS 1
|
||
DEV.FD .BS 1
|
||
DEV.DIB .BS S.DIB
|
||
DEV.SFLAGS .BS 9
|
||
DS.END
|
||
.ED
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/BIN/LSDEV.S
|
||
ASM
|