2018-01-19 16:21:31 +00:00
|
|
|
|
NEW
|
|
|
|
|
PREFIX /A2OSX.BUILD
|
|
|
|
|
AUTO 4,1
|
|
|
|
|
*--------------------------------------
|
2018-01-22 07:34:59 +00:00
|
|
|
|
X.SLIST jmp (.1-SYS.SListAdd,x)
|
2018-01-19 16:21:31 +00:00
|
|
|
|
.1 .DA SLIST.Add
|
|
|
|
|
.DA SLIST.Lookup
|
|
|
|
|
.DA SLIST.GetByID
|
|
|
|
|
.DA SLIST.UpdateByID
|
|
|
|
|
.DA SLIST.New
|
2018-06-21 15:12:10 +00:00
|
|
|
|
.DA SLIST.Free
|
2018-01-19 16:21:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.Add jsr SLIST.Search
|
2018-01-24 16:24:06 +00:00
|
|
|
|
bcc .99 Lookup succeeded...DUP
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-01-22 16:52:04 +00:00
|
|
|
|
ldy #$ff
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-01-22 16:52:04 +00:00
|
|
|
|
.1 iny
|
|
|
|
|
jsr MEM.GetKeyCharY
|
2018-01-19 16:21:31 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
sty .8+1
|
|
|
|
|
tya
|
2018-01-22 16:52:04 +00:00
|
|
|
|
beq .9 CS
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
jsr SLIST.AddBlockByte
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.2 jsr MEM.GetKeyCharY
|
|
|
|
|
bcs .3
|
|
|
|
|
|
|
|
|
|
jsr SLIST.AddBlockByte
|
|
|
|
|
bcs .9
|
|
|
|
|
iny
|
|
|
|
|
bra .2
|
|
|
|
|
|
2018-01-31 16:20:20 +00:00
|
|
|
|
.3 jsr MEM.GetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
tax
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr SLIST.AddBlockByte
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-01-31 16:20:20 +00:00
|
|
|
|
.4 jsr MEM.GetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
jsr SLIST.AddBlockByte
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
|
|
|
|
|
2018-01-29 16:48:07 +00:00
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.HS B0 BCS
|
|
|
|
|
|
|
|
|
|
.99 sec
|
2018-03-30 15:21:42 +00:00
|
|
|
|
ldx ZPSListID
|
|
|
|
|
ldy ZPSListID+1
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-01-29 16:48:07 +00:00
|
|
|
|
.9 rts
|
2018-01-19 16:21:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.Lookup jsr SLIST.Search
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-01-31 16:20:20 +00:00
|
|
|
|
sty .8+1 Save Key Length
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
jsr SLIST.GetBlockByte
|
|
|
|
|
tax
|
2018-01-31 16:20:20 +00:00
|
|
|
|
jsr MEM.SetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.1 jsr SLIST.GetNextBlockByte
|
2018-01-31 16:20:20 +00:00
|
|
|
|
jsr MEM.SetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
2018-03-30 15:21:42 +00:00
|
|
|
|
ldx ZPSListID
|
|
|
|
|
ldy ZPSListID+1
|
2018-01-31 16:20:20 +00:00
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.GetByID jsr SLIST.Select
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr SLIST.GetBlockByte
|
|
|
|
|
|
|
|
|
|
tax
|
2018-01-24 16:24:06 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
jsr MEM.SetKeyCharY
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.1 jsr SLIST.GetNextBlockByte
|
2018-03-30 15:21:42 +00:00
|
|
|
|
iny
|
|
|
|
|
jsr MEM.SetKeyCharY
|
2018-01-19 16:21:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
jsr SLIST.GetNextBlockByte
|
2018-01-22 16:52:04 +00:00
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
tax
|
2018-01-22 16:52:04 +00:00
|
|
|
|
|
2018-01-31 16:20:20 +00:00
|
|
|
|
jsr MEM.SetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.2 jsr SLIST.GetNextBlockByte
|
2018-01-31 16:20:20 +00:00
|
|
|
|
jsr MEM.SetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .2
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
jsr SLIST.GetNextBlockByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
clc
|
2018-01-29 16:48:07 +00:00
|
|
|
|
.HS B0 BCS
|
2018-01-19 16:21:31 +00:00
|
|
|
|
.9 sec
|
2018-01-29 16:48:07 +00:00
|
|
|
|
ldx SLIST.BlockOfs
|
|
|
|
|
ldy SLIST.IndexOfs
|
2018-01-19 16:21:31 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.UpdateByID
|
|
|
|
|
jsr SLIST.Select
|
|
|
|
|
|
2018-01-24 16:24:06 +00:00
|
|
|
|
jsr SLIST.GetBlockByte
|
|
|
|
|
tax
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.1 jsr SLIST.GetNextBlockByte
|
2018-01-24 16:24:06 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
jsr SLIST.GetNextBlockByte set pos at DATALEN
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-01-31 16:20:20 +00:00
|
|
|
|
jsr MEM.GetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
jsr SLIST.SetBlockByte
|
|
|
|
|
|
2018-01-31 16:20:20 +00:00
|
|
|
|
.4 jsr MEM.GetDataByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr SLIST.SetBlockByte
|
|
|
|
|
dex
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
clc
|
2018-01-24 16:24:06 +00:00
|
|
|
|
rts
|
2018-01-19 16:21:31 +00:00
|
|
|
|
*--------------------------------------
|
2018-01-22 07:34:59 +00:00
|
|
|
|
SLIST.New >LDYAI 160 40k Max before out of memory!!!
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMem0
|
2018-01-22 07:34:59 +00:00
|
|
|
|
bcs .9
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListIBlkPtr
|
2018-01-22 07:34:59 +00:00
|
|
|
|
stx .8+1
|
|
|
|
|
|
|
|
|
|
>LDYAI 256
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMem0
|
2018-01-22 07:34:59 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
txa
|
2018-03-30 15:21:42 +00:00
|
|
|
|
sta (ZPSListIBlkPtr)
|
2018-01-22 07:34:59 +00:00
|
|
|
|
|
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2018-06-21 15:12:10 +00:00
|
|
|
|
SLIST.Free sta .8+1
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2018-01-19 16:21:31 +00:00
|
|
|
|
>STYA .1+1
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 lda $ffff,x SELF MODIFIED
|
|
|
|
|
beq .8
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.FreeMem
|
2018-01-19 16:21:31 +00:00
|
|
|
|
inx
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jmp K.FreeMem
|
2018-01-19 16:21:31 +00:00
|
|
|
|
*--------------------------------------
|
2018-06-21 15:12:10 +00:00
|
|
|
|
SLIST.Select jsr K.GetMemPtr
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListIBlkPtr
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
ldy ZPSListID+1
|
2018-01-23 16:52:22 +00:00
|
|
|
|
sty SLIST.IndexOfs
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPSListIBlkPtr),y
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListDBlkPtr
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda ZPSListID
|
2018-01-19 16:21:31 +00:00
|
|
|
|
sta SLIST.BlockOfs
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-06-21 15:12:10 +00:00
|
|
|
|
SLIST.Search jsr K.GetMemPtr
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListIBlkPtr
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
stz SLIST.IndexOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
stz ZPSListID+1
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPSListIBlkPtr)
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListDBlkPtr
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
stz SLIST.BlockOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
stz ZPSListID
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
jsr SLIST.GetBlockByte
|
|
|
|
|
tax
|
|
|
|
|
beq .9
|
2018-01-25 16:13:28 +00:00
|
|
|
|
|
2018-01-24 16:24:06 +00:00
|
|
|
|
.1 ldy #0
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
.2 jsr MEM.GetKeyCharY
|
2018-01-25 16:13:28 +00:00
|
|
|
|
bcs .40
|
2018-01-19 16:21:31 +00:00
|
|
|
|
iny
|
|
|
|
|
sta .3+1
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
jsr SLIST.GetNextBlockByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
.3 cmp #$ff SELF MODIFIED
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
2018-01-24 16:24:06 +00:00
|
|
|
|
jsr MEM.GetKeyCharY
|
|
|
|
|
bcs .8 End of Key....match!!!!
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
jsr SLIST.GetNextBlockByte
|
2018-01-24 16:24:06 +00:00
|
|
|
|
bra .41
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.8 jsr SLIST.GetNextBlockByte Advance to DATA LEN
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
clc Y = Key Length
|
|
|
|
|
rts
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.40 inx
|
|
|
|
|
|
|
|
|
|
.4 jsr SLIST.GetNextBlockByte skip remaining key chars
|
2018-01-19 16:21:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .4
|
|
|
|
|
|
2018-01-24 16:24:06 +00:00
|
|
|
|
.41 tax A=get Data Len
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.5 jsr SLIST.GetNextBlockByte skip data bytes
|
2018-01-19 16:21:31 +00:00
|
|
|
|
dex
|
|
|
|
|
bne .5
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
jsr SLIST.GetNextBlockByte
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
|
|
|
|
ldx SLIST.IndexOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
stx ZPSListID+1
|
2018-01-24 16:24:06 +00:00
|
|
|
|
ldx SLIST.BlockOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
stx ZPSListID
|
2018-01-24 16:24:06 +00:00
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
bne .1
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-01-25 16:13:28 +00:00
|
|
|
|
SLIST.GetNextBlockByte
|
2018-01-24 16:24:06 +00:00
|
|
|
|
phy
|
2018-01-25 16:13:28 +00:00
|
|
|
|
ldy SLIST.BlockOfs
|
|
|
|
|
iny
|
|
|
|
|
beq .1
|
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPSListDBlkPtr),y
|
2018-01-25 16:13:28 +00:00
|
|
|
|
sty SLIST.BlockOfs
|
|
|
|
|
ply
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 ldy SLIST.IndexOfs
|
|
|
|
|
iny
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPSListIBlkPtr),y
|
2018-01-30 16:24:45 +00:00
|
|
|
|
beq .9 Exit with A=0
|
2018-01-25 16:13:28 +00:00
|
|
|
|
|
|
|
|
|
sty SLIST.IndexOfs
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListDBlkPtr
|
2018-01-25 16:13:28 +00:00
|
|
|
|
stz SLIST.BlockOfs
|
|
|
|
|
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPSListDBlkPtr)
|
2018-01-30 16:24:45 +00:00
|
|
|
|
.9 ply
|
2018-01-25 16:13:28 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2018-01-24 16:24:06 +00:00
|
|
|
|
SLIST.GetBlockByte
|
|
|
|
|
phy
|
|
|
|
|
ldy SLIST.BlockOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPSListDBlkPtr),y
|
2018-01-24 16:24:06 +00:00
|
|
|
|
ply
|
2018-01-19 16:21:31 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.AddBlockByte
|
|
|
|
|
phy
|
|
|
|
|
ldy SLIST.BlockOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
sta (ZPSListDBlkPtr),y
|
2018-01-19 16:21:31 +00:00
|
|
|
|
inc SLIST.BlockOfs
|
|
|
|
|
bne .8
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
phx
|
2018-01-19 16:21:31 +00:00
|
|
|
|
>LDYAI 256
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMem0
|
2018-01-19 16:21:31 +00:00
|
|
|
|
bcs .9
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListDBlkPtr
|
2018-01-19 16:21:31 +00:00
|
|
|
|
txa
|
2018-01-25 16:13:28 +00:00
|
|
|
|
|
|
|
|
|
inc SLIST.IndexOfs
|
2018-01-19 16:21:31 +00:00
|
|
|
|
ldy SLIST.IndexOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
sta (ZPSListIBlkPtr),y
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
* stz SLIST.BlockOfs
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
plx
|
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
.8 ply
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.9 plx
|
|
|
|
|
ply
|
2018-01-19 16:21:31 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.SetBlockByte
|
|
|
|
|
phy
|
|
|
|
|
ldy SLIST.BlockOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
sta (ZPSListDBlkPtr),y
|
2018-01-19 16:21:31 +00:00
|
|
|
|
inc SLIST.BlockOfs
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
inc SLIST.IndexOfs
|
|
|
|
|
|
|
|
|
|
ldy SLIST.IndexOfs
|
2018-03-30 15:21:42 +00:00
|
|
|
|
lda (ZPSListIBlkPtr),y
|
2018-01-25 16:13:28 +00:00
|
|
|
|
beq *
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2018-03-30 15:21:42 +00:00
|
|
|
|
>STYA ZPSListDBlkPtr
|
2018-01-19 16:21:31 +00:00
|
|
|
|
* stz SLIST.BlockOfs
|
|
|
|
|
|
|
|
|
|
.8 ply
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.IndexOfs .BS 1
|
|
|
|
|
SLIST.BlockOfs .BS 1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.SLIST
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
|
|
|
|
ASM
|