A2osX/BIN/LSDEV.S.txt

116 lines
2.2 KiB
Plaintext
Raw Normal View History

PR#3
2015-06-03 18:30:57 +00:00
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.LIST OFF
.OP 65C02
.OR $2000
2015-06-03 18:30:57 +00:00
.TF /A2OSX.BOOT/BIN/LSDEV
*--------------------------------------
.INB /A2OSX.DEV/INC/MACROS.I
.INB /A2OSX.DEV/INC/PRODOS.I
.INB /A2OSX.DEV/INC/A2OSX.I
*--------------------------------------
ZPPTR1 .EQ ZPBIN
ZPPTR2 .EQ ZPBIN+2
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
*--------------------------------------
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
.DA CS.END-CS.START Code Length To Relocate
.DA 0 Data Segment to Allocate
.DA 0
.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
2017-01-12 17:43:45 +00:00
L.DEV.NAME .DA DEV.NAME
.DA 0
*--------------------------------------
2017-01-12 17:43:45 +00:00
CS.INIT clc
rts
*--------------------------------------
2017-01-12 17:43:45 +00:00
CS.RUN >LDYA L.MSG0
>SYSCALL CPrintFYA
>LDYAI DevMgr.Table
>STYA ZPPTR1
stz DEV.ID
2017-01-12 17:43:45 +00:00
.1 lda DEV.ID
>SYSCALL GetDevByIDA
bcs .8
>STYA ZPPTR1
2016-06-07 06:10:18 +00:00
ldy #S.DEV.JMP+1
>PUSHB (ZPPTR1),y
dey
>PUSHB (ZPPTR1),y
2017-01-12 17:43:45 +00:00
ldy #S.DEV.F
lda (ZPPTR1),y
and #S.DEV.F.LEN
sta DEV.NAME
tax
iny
.2 lda (ZPPTR1),y
sta DEV.NAME-S.DEV.F,y
iny
dex
bne .2
>PUSHW L.DEV.NAME
2015-06-03 18:30:57 +00:00
ldy #S.DEV.F
2016-06-07 06:10:18 +00:00
>PUSHB (ZPPTR1),y
2017-01-12 17:43:45 +00:00
ldy #S.DEV.S
2016-06-07 06:10:18 +00:00
>PUSHB (ZPPTR1),y
2017-01-12 17:43:45 +00:00
>PUSHB DEV.ID
>LDYA L.MSG1
>SYSCALL CPrintFYA
2015-06-03 18:30:57 +00:00
2017-01-12 17:43:45 +00:00
inc DEV.ID
2015-06-03 18:30:57 +00:00
lda ZPPTR1
clc
adc #S.DEV
sta ZPPTR1
2017-01-12 17:43:45 +00:00
bcc .1
inc ZPPTR1+1
2017-01-12 17:43:45 +00:00
bra .1
2015-06-03 18:30:57 +00:00
2017-01-12 17:43:45 +00:00
.8 lda #0 tell TSKMGR that all done ok, but
.9 sec we do not want to stay in memory
rts
*--------------------------------------
CS.EVENT
CS.QUIT clc
rts
*--------------------------------------
CS.END
2017-01-12 17:43:45 +00:00
MSG0 >CSTR "ID Status Flags Name Address\n"
MSG1 >CSTR "%03d %b %b %4S $%H\n"
*--------------------------------------
2015-06-03 18:30:57 +00:00
DEV.ID .BS 1
2017-01-12 17:43:45 +00:00
DEV.NAME .BS 5
MAN
SAVE BIN/LSDEV.S
ASM