2015-03-14 21:47:37 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2015-03-14 21:47:37 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.TF /A2OSX.BUILD/BIN/LSDEV
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/PRODOS.I
|
|
|
|
|
.INB /A2OSX.BUILD/INC/A2OSX.I
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPPTR1 .EQ ZPBIN
|
2016-11-25 16:20:28 +00:00
|
|
|
|
ZPPTR2 .EQ ZPBIN+2
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
2017-09-21 15:29:45 +00:00
|
|
|
|
.DA CS.END-CS.START CS
|
|
|
|
|
.DA DS.END-DS.START DS
|
|
|
|
|
.DA #16 SS
|
|
|
|
|
.DA #4 ZP
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.EVENT
|
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.MSG0 .DA MSG0
|
|
|
|
|
L.MSG1 .DA MSG1
|
2017-03-20 16:54:27 +00:00
|
|
|
|
L.MSG2.C .DA MSG2.C
|
|
|
|
|
L.MSG2.B .DA MSG2.B
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
CS.INIT clc
|
2016-11-24 17:00:03 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
CS.RUN >LDYA L.MSG0
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-01-25 21:46:40 +00:00
|
|
|
|
|
2017-09-21 15:29:45 +00:00
|
|
|
|
>LDA.G DEV.ID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2017-09-21 15:29:45 +00:00
|
|
|
|
.1 >SYSCALL GetDevByID.A
|
2017-03-20 16:54:27 +00:00
|
|
|
|
bcs .7
|
2017-02-02 17:30:07 +00:00
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
>STYA ZPPTR1
|
|
|
|
|
|
2017-03-20 16:54:27 +00:00
|
|
|
|
jsr DumpHeader
|
|
|
|
|
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2017-09-21 15:29:45 +00:00
|
|
|
|
>LDA.G DEV.ID
|
|
|
|
|
>SYSCALL GetDevByID.A
|
2017-03-20 16:54:27 +00:00
|
|
|
|
>STYA pDev
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
2017-03-20 16:54:27 +00:00
|
|
|
|
ldx #DEVMGR.STATUS
|
|
|
|
|
jsr pDevJmp
|
|
|
|
|
bcs .6
|
|
|
|
|
>STYA ZPPTR2
|
|
|
|
|
|
|
|
|
|
jsr DumpStatus
|
|
|
|
|
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.6 lda #13
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL PutChar.A
|
2017-03-20 16:54:27 +00:00
|
|
|
|
lda #10
|
2017-08-25 06:37:21 +00:00
|
|
|
|
>SYSCALL PutChar.A
|
2017-03-20 16:54:27 +00:00
|
|
|
|
|
2017-09-21 15:29:45 +00:00
|
|
|
|
.7 >LDA.G DEV.ID
|
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
2017-03-20 16:54:27 +00:00
|
|
|
|
cmp #K.DEV.MAX
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 lda #0 tell TSKMGR that all done ok, but
|
|
|
|
|
.9 sec we do not want to stay in memory
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
DumpHeader ldy #S.DEV.DRV.JMP+1
|
|
|
|
|
>PUSHB (ZPPTR1),y
|
2017-01-25 21:46:40 +00:00
|
|
|
|
|
2016-06-07 06:10:18 +00:00
|
|
|
|
dey
|
2017-03-20 16:54:27 +00:00
|
|
|
|
>PUSHB (ZPPTR1),y
|
2016-06-07 06:10:18 +00:00
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
lda #S.DEV.NAME
|
|
|
|
|
clc
|
2017-03-20 16:54:27 +00:00
|
|
|
|
adc ZPPTR1
|
2017-03-15 16:44:15 +00:00
|
|
|
|
tay
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
lda /S.DEV.NAME
|
2017-03-20 16:54:27 +00:00
|
|
|
|
adc ZPPTR1+1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2017-03-15 16:44:15 +00:00
|
|
|
|
>PUSHYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #S.DEV.F
|
2017-03-20 16:54:27 +00:00
|
|
|
|
>PUSHB (ZPPTR1),y
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldy #S.DEV.S
|
2017-09-21 15:29:45 +00:00
|
|
|
|
lda (ZPPTR1),y
|
|
|
|
|
>STA.G DEV.S
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2017-09-21 15:29:45 +00:00
|
|
|
|
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
|
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
>PUSHEA.G DEV.SFLAGS
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
|
|
|
|
>LDA.G DEV.ID
|
|
|
|
|
>PUSHA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
2016-10-17 06:21:04 +00:00
|
|
|
|
>LDYA L.MSG1
|
2017-08-25 15:02:16 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-03-20 16:54:27 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-09-21 15:29:45 +00:00
|
|
|
|
DumpStatus >LDA.G DEV.S
|
2017-03-20 16:54:27 +00:00
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
ldy #S.DEVSTAT.SIZE
|
|
|
|
|
lda (ZPPTR2),y
|
2017-09-21 15:29:45 +00:00
|
|
|
|
>STA.G DEV.SIZE
|
|
|
|
|
|
|
|
|
|
ldy #S.DEVSTAT.SIZE+1
|
2017-03-20 16:54:27 +00:00
|
|
|
|
lda (ZPPTR2),y
|
2017-09-21 15:29:45 +00:00
|
|
|
|
>STA.G DEV.SIZE+1
|
|
|
|
|
|
|
|
|
|
ldy #S.DEVSTAT.SIZE+2
|
2017-03-20 16:54:27 +00:00
|
|
|
|
lda (ZPPTR2),y
|
2017-09-21 15:29:45 +00:00
|
|
|
|
>STA.G DEV.SIZE+2
|
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
>PUSHEA.G DEV.SIZE
|
2017-03-20 16:54:27 +00:00
|
|
|
|
|
|
|
|
|
.1 ldy #S.DEVSTAT.VERSION+1
|
2017-01-25 21:46:40 +00:00
|
|
|
|
>PUSHB (ZPPTR2),y
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (ZPPTR2),y
|
|
|
|
|
|
|
|
|
|
lda ZPPTR2
|
|
|
|
|
clc
|
|
|
|
|
adc #S.DEVSTAT.IDSTRING
|
|
|
|
|
tay
|
|
|
|
|
lda ZPPTR2+1
|
|
|
|
|
adc #0
|
|
|
|
|
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
|
|
|
|
ldy #S.DEVSTAT.SUBTYPE
|
|
|
|
|
>PUSHB (ZPPTR2),y
|
|
|
|
|
dey
|
|
|
|
|
>PUSHB (ZPPTR2),y
|
|
|
|
|
|
2017-09-21 15:29:45 +00:00
|
|
|
|
>LDA.G DEV.S
|
2017-03-20 16:54:27 +00:00
|
|
|
|
bpl .2
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
2017-03-20 16:54:27 +00:00
|
|
|
|
>LDYA L.MSG2.B
|
|
|
|
|
bra .3
|
|
|
|
|
.2 >LDYA L.MSG2.C
|
2016-11-25 16:20:28 +00:00
|
|
|
|
|
2017-08-25 15:02:16 +00:00
|
|
|
|
.3 >SYSCALL PrintF.YA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-15 20:51:20 +00:00
|
|
|
|
CS.EVENT sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-10-17 06:21:04 +00:00
|
|
|
|
CS.QUIT clc
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-11-24 17:00:03 +00:00
|
|
|
|
CS.END
|
2017-03-20 16:54:27 +00:00
|
|
|
|
MSG0 >CSTR "ID Status Flags Name Addr. Typ/Sub IDString Version Size (BLK)\r\n"
|
2017-09-21 15:29:45 +00:00
|
|
|
|
MSG1 >CSTR "%03d %s %b %4s $%H "
|
2017-03-20 16:54:27 +00:00
|
|
|
|
MSG2.B >CSTR "$%h/$%h %16S %03d.%03d %10u"
|
|
|
|
|
MSG2.C >CSTR "$%h/$%h %16S %03d.%03d n/a"
|
2017-09-21 15:29:45 +00:00
|
|
|
|
MSG.SFLAGS .AS "BWRLNEIO"
|
2016-11-24 17:00:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-21 15:29:45 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2015-06-03 18:30:57 +00:00
|
|
|
|
DEV.ID .BS 1
|
2017-03-20 16:54:27 +00:00
|
|
|
|
DEV.S .BS 1
|
|
|
|
|
DEV.SIZE .BS 4
|
2017-09-21 15:29:45 +00:00
|
|
|
|
DEV.SFLAGS .BS 9
|
|
|
|
|
DS.END
|
|
|
|
|
.ED
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/BIN/LSDEV.S
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ASM
|