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
|
|
|
|
|
.DA SLIST.Free.A
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
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-22 16:52:04 +00:00
|
|
|
|
.3 ldy #0
|
|
|
|
|
|
|
|
|
|
jsr MEM.GetDataByteY
|
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-22 16:52:04 +00:00
|
|
|
|
.4 iny
|
|
|
|
|
jsr MEM.GetDataByteY
|
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-01-19 16:21:31 +00:00
|
|
|
|
ldx SLIST.ID
|
|
|
|
|
ldy SLIST.ID+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
|
|
|
|
|
|
|
|
|
|
sty .8+1
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
jsr SLIST.GetBlockByte
|
|
|
|
|
tax
|
|
|
|
|
jsr MEM.SetDataByteY
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.1 jsr SLIST.GetNextBlockByte
|
2018-01-19 16:21:31 +00:00
|
|
|
|
iny
|
|
|
|
|
jsr MEM.SetDataByteY
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
|
|
|
|
ldx SLIST.ID
|
|
|
|
|
ldy SLIST.ID+1
|
|
|
|
|
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-01-22 16:52:04 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr MEM.SetDataByteY
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.1 jsr SLIST.GetNextBlockByte
|
2018-01-23 16:52:22 +00:00
|
|
|
|
iny
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr MEM.SetDataByteY
|
|
|
|
|
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-23 16:52:22 +00:00
|
|
|
|
iny
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr MEM.SetDataByteY
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
.2 jsr SLIST.GetNextBlockByte
|
2018-01-23 16:52:22 +00:00
|
|
|
|
iny
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr MEM.SetDataByteY
|
|
|
|
|
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-19 16:21:31 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
jsr MEM.GetDataByteY
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
jsr SLIST.SetBlockByte
|
|
|
|
|
|
|
|
|
|
.4 iny
|
|
|
|
|
jsr MEM.GetDataByteY
|
|
|
|
|
|
|
|
|
|
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!!!
|
|
|
|
|
jsr K.GetMem0.YA
|
|
|
|
|
bcs .9
|
|
|
|
|
>STYA ZPSListIndex
|
|
|
|
|
stx .8+1
|
|
|
|
|
|
|
|
|
|
>LDYAI 256
|
|
|
|
|
jsr K.GetMem0.YA
|
|
|
|
|
bcs .9
|
|
|
|
|
txa
|
|
|
|
|
sta (ZPSListIndex)
|
|
|
|
|
|
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.Free.A sta .8+1
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
|
|
|
|
jsr K.GetMemPtr.A
|
|
|
|
|
>STYA .1+1
|
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 lda $ffff,x SELF MODIFIED
|
|
|
|
|
beq .8
|
|
|
|
|
jsr K.FreeMem.A
|
|
|
|
|
inx
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
|
|
|
|
jmp K.FreeMem.A
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.Select jsr K.GetMemPtr.A
|
|
|
|
|
>STYA ZPSListIndex
|
|
|
|
|
|
2018-01-23 16:52:22 +00:00
|
|
|
|
ldy ZPSListKey+1
|
|
|
|
|
sty SLIST.IndexOfs
|
2018-01-19 16:21:31 +00:00
|
|
|
|
|
2018-01-30 16:24:45 +00:00
|
|
|
|
lda (ZPSListIndex),y
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr K.GetMemPtr.A
|
|
|
|
|
>STYA ZPSListBlock
|
|
|
|
|
|
2018-01-23 16:52:22 +00:00
|
|
|
|
lda ZPSListKey
|
2018-01-19 16:21:31 +00:00
|
|
|
|
sta SLIST.BlockOfs
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.Search jsr K.GetMemPtr.A
|
|
|
|
|
>STYA ZPSListIndex
|
|
|
|
|
|
|
|
|
|
stz SLIST.IndexOfs
|
2018-01-24 16:24:06 +00:00
|
|
|
|
stz SLIST.ID+1
|
|
|
|
|
|
2018-01-30 16:24:45 +00:00
|
|
|
|
lda (ZPSListIndex)
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr K.GetMemPtr.A
|
|
|
|
|
>STYA ZPSListBlock
|
|
|
|
|
|
|
|
|
|
stz SLIST.BlockOfs
|
2018-01-24 16:24:06 +00:00
|
|
|
|
stz SLIST.ID
|
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
|
|
|
|
|
stx SLIST.ID+1
|
|
|
|
|
ldx SLIST.BlockOfs
|
|
|
|
|
stx SLIST.ID
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
lda (ZPSListBlock),y
|
|
|
|
|
sty SLIST.BlockOfs
|
|
|
|
|
ply
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 ldy SLIST.IndexOfs
|
|
|
|
|
iny
|
2018-01-19 16:21:31 +00:00
|
|
|
|
lda (ZPSListIndex),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
|
|
|
|
|
|
|
|
|
jsr K.GetMemPtr.A
|
|
|
|
|
>STYA ZPSListBlock
|
2018-01-25 16:13:28 +00:00
|
|
|
|
stz SLIST.BlockOfs
|
|
|
|
|
|
|
|
|
|
lda (ZPSListBlock)
|
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
|
|
|
|
|
lda (ZPSListBlock),y
|
|
|
|
|
ply
|
2018-01-19 16:21:31 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.AddBlockByte
|
|
|
|
|
phy
|
|
|
|
|
ldy SLIST.BlockOfs
|
|
|
|
|
sta (ZPSListBlock),y
|
|
|
|
|
inc SLIST.BlockOfs
|
|
|
|
|
bne .8
|
|
|
|
|
|
2018-01-25 16:13:28 +00:00
|
|
|
|
phx
|
2018-01-19 16:21:31 +00:00
|
|
|
|
>LDYAI 256
|
|
|
|
|
jsr K.GetMem0.YA
|
|
|
|
|
bcs .9
|
|
|
|
|
>STYA ZPSListBlock
|
|
|
|
|
txa
|
2018-01-25 16:13:28 +00:00
|
|
|
|
|
|
|
|
|
inc SLIST.IndexOfs
|
2018-01-19 16:21:31 +00:00
|
|
|
|
ldy SLIST.IndexOfs
|
|
|
|
|
sta (ZPSListIndex),y
|
|
|
|
|
|
|
|
|
|
* 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
|
|
|
|
|
sta (ZPSListBlock),y
|
|
|
|
|
inc SLIST.BlockOfs
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
inc SLIST.IndexOfs
|
|
|
|
|
|
|
|
|
|
ldy SLIST.IndexOfs
|
|
|
|
|
lda (ZPSListIndex),y
|
2018-01-25 16:13:28 +00:00
|
|
|
|
beq *
|
2018-01-19 16:21:31 +00:00
|
|
|
|
jsr K.GetMemPtr.A
|
|
|
|
|
>STYA ZPSListBlock
|
|
|
|
|
* stz SLIST.BlockOfs
|
|
|
|
|
|
|
|
|
|
.8 ply
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
SLIST.IndexOfs .BS 1
|
|
|
|
|
SLIST.BlockOfs .BS 1
|
|
|
|
|
SLIST.ID .BS 2
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.SLIST
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
|
|
|
|
ASM
|