A2osX/SYS/KERNEL.S.SLISTX.txt

490 lines
7.8 KiB
Plaintext
Raw Normal View History

NEW
2019-04-10 15:51:47 +00:00
AUTO 3,1
*--------------------------------------
2020-02-20 16:54:51 +00:00
ZPSListDataOfs .EQ ZPMEMMGR+8
2019-07-29 15:38:55 +00:00
ZPSListDataLen .EQ ZPMEMMGR+10
2020-02-18 15:34:56 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.Opt .BS 1
SLISTX.KeyLen .BS 1
SLISTX.DataLen .BS 2
SLISTX.nDataCnt .BS 2
SLISTX.nBufCnt .BS 2
SLISTX.bStr .BS 1
SLISTX.b0 .BS 1
SLISTX.KeyID .BS 2
2020-02-18 15:34:56 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.GetData jsr SLISTX.Select
2020-02-20 07:41:52 +00:00
2022-11-02 06:54:30 +00:00
jsr SLISTX.SkipKey
2019-03-18 06:53:20 +00:00
2022-11-02 06:54:30 +00:00
jsr SLISTX.GetDataLen
lda SLISTX.DataLen
2019-03-15 16:20:28 +00:00
sec
2020-02-20 16:54:51 +00:00
sbc ZPSListDataOfs Offset
2019-03-15 16:20:28 +00:00
eor #$ff
2022-11-02 06:54:30 +00:00
sta SLISTX.nDataCnt
2020-01-26 19:36:49 +00:00
2022-11-02 06:54:30 +00:00
lda SLISTX.DataLen+1
2020-02-20 16:54:51 +00:00
sbc ZPSListDataOfs+1
2019-03-15 16:20:28 +00:00
eor #$ff
2022-11-02 06:54:30 +00:00
sta SLISTX.nDataCnt+1 Data remaining
2019-03-18 16:48:16 +00:00
2019-08-12 07:40:16 +00:00
bcc .99 Offset Beyond DataLen
2019-03-18 16:48:16 +00:00
2020-08-18 08:00:26 +00:00
lda ZPSListDataOfs Skip to Offset
2020-02-20 16:54:51 +00:00
ldx ZPSListDataOfs+1
2022-11-02 06:54:30 +00:00
jsr SLISTX.SkipDataAX
2019-03-18 16:48:16 +00:00
2022-11-02 06:54:30 +00:00
stz SLISTX.b0
2020-08-18 08:00:26 +00:00
2020-02-18 15:34:56 +00:00
lda FORPNT
ora FORPNT+1
2020-08-17 13:03:39 +00:00
bne .12 buffer provided
2020-01-26 19:36:49 +00:00
2022-11-02 06:54:30 +00:00
>LDYA SLISTX.DataLen
2020-01-26 19:36:49 +00:00
2019-08-12 07:40:16 +00:00
iny
bne .11
2022-11-02 06:54:30 +00:00
2019-08-12 07:40:16 +00:00
inc +1 for ending 0
2020-01-26 19:36:49 +00:00
2020-08-18 08:00:26 +00:00
sec
2022-11-02 06:54:30 +00:00
ror SLISTX.b0
2020-08-18 08:00:26 +00:00
2019-08-12 07:40:16 +00:00
.11 ldx #SYS.GetMem
2019-08-05 13:30:58 +00:00
jsr K.SYSCALL2.MAIN !!! Get a buffer In MAIN Mem !!!
2019-03-18 16:48:16 +00:00
bcs .9
2022-11-02 06:54:30 +00:00
2020-02-21 13:24:16 +00:00
stx .88+1
2020-02-18 15:34:56 +00:00
>STYA FORPNT
2019-03-18 16:48:16 +00:00
.12 lda ZPSListDataLen
ora ZPSListDataLen+1
2019-03-18 06:53:20 +00:00
sec
2019-03-15 16:20:28 +00:00
beq .1 String Mode
2020-01-26 19:36:49 +00:00
2019-03-15 16:20:28 +00:00
lda ZPSListDataLen
eor #$ff
2022-11-02 06:54:30 +00:00
sta SLISTX.nBufCnt
2019-03-15 16:20:28 +00:00
lda ZPSListDataLen+1
eor #$ff
2022-11-02 06:54:30 +00:00
sta SLISTX.nBufCnt+1
2019-03-18 06:53:20 +00:00
clc
2020-01-26 19:36:49 +00:00
2022-11-02 06:54:30 +00:00
.1 ror SLISTX.bStr
2019-03-15 16:20:28 +00:00
stz ZPSListDataLen
stz ZPSListDataLen+1
2020-01-26 19:36:49 +00:00
2022-11-02 06:54:30 +00:00
.2 inc SLISTX.nDataCnt
2019-03-15 16:20:28 +00:00
bne .3
2022-11-02 06:54:30 +00:00
inc SLISTX.nDataCnt+1
2020-08-17 13:03:39 +00:00
beq .80
2020-01-26 19:36:49 +00:00
2022-11-02 06:54:30 +00:00
.3 bit SLISTX.bStr
2020-01-26 19:36:49 +00:00
bmi .4 String mode : until CR
2022-11-02 06:54:30 +00:00
inc SLISTX.nBufCnt
2019-03-15 16:20:28 +00:00
bne .4
2022-11-02 06:54:30 +00:00
inc SLISTX.nBufCnt+1
2020-08-18 08:00:26 +00:00
beq .80 not string mode : until end of buffer
2020-01-26 19:36:49 +00:00
2021-05-04 17:31:21 +00:00
.4 jsr BLISTX.GetNByte
2022-11-02 06:54:30 +00:00
bit SLISTX.bStr
2019-03-15 16:20:28 +00:00
bpl .5
2020-02-21 13:24:16 +00:00
2019-03-15 16:20:28 +00:00
cmp #C.CR
2020-02-21 13:24:16 +00:00
beq .81
2021-05-04 17:31:21 +00:00
.5 jsr SHARED.FORPNTpn
2019-03-15 16:20:28 +00:00
inc ZPSListDataLen
bne .2
2019-03-15 16:20:28 +00:00
inc ZPSListDataLen+1
bra .2
2019-03-18 06:53:20 +00:00
2019-05-12 20:45:11 +00:00
.99 lda #E.EMPTYKEY
2019-03-15 16:20:28 +00:00
sec
2019-03-18 16:48:16 +00:00
.9 rts
2019-03-18 06:53:20 +00:00
2022-11-02 06:54:30 +00:00
.80 lda SLISTX.bStr
ora SLISTX.b0
2020-02-21 13:24:16 +00:00
bpl .82
.81 lda #0
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTpn
2020-02-21 13:24:16 +00:00
.82 >LDYA ZPSListDataLen
.88 ldx #$ff SELF MODIFIED
2019-03-18 06:53:20 +00:00
clc
rts
2020-02-18 15:34:56 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.AddData jsr SLISTX.Select
2020-02-20 07:41:52 +00:00
2022-11-02 06:54:30 +00:00
jsr SLISTX.SkipKey
2018-01-29 16:48:07 +00:00
jsr SLISTX.CheckLen
2021-05-04 17:31:21 +00:00
ldy iByte
lda (DBlkPtr),y
2019-03-15 16:20:28 +00:00
pha
2018-01-29 16:48:07 +00:00
clc
2019-03-27 17:01:01 +00:00
adc ZPSListDataLen
2021-05-04 17:31:21 +00:00
sta (DBlkPtr),y
2019-03-27 17:01:01 +00:00
php
2021-05-04 17:31:21 +00:00
jsr BLISTX.2NByte skip LEN lo
2019-03-27 17:01:01 +00:00
plp
2021-05-04 17:31:21 +00:00
ldy iByte
lda (DBlkPtr),y
2019-03-27 17:01:01 +00:00
pha
adc ZPSListDataLen+1
2021-05-04 17:31:21 +00:00
sta (DBlkPtr),y
jsr BLISTX.2NByte skip LEN hi
2019-03-27 17:01:01 +00:00
plx
2019-03-15 16:20:28 +00:00
pla
2022-11-02 06:54:30 +00:00
jsr SLISTX.SkipDataAX
2019-03-27 17:01:01 +00:00
lda ZPSListDataLen
2019-03-15 16:20:28 +00:00
eor #$ff
sta ZPSListDataLen
lda ZPSListDataLen+1
eor #$ff
sta ZPSListDataLen+1
2020-03-06 16:20:29 +00:00
sec
2019-03-15 16:20:28 +00:00
.1 inc ZPSListDataLen
bne .2
2019-03-15 16:20:28 +00:00
inc ZPSListDataLen+1
beq .8
2021-05-04 17:31:21 +00:00
.2 jsr SHARED.FORPNTgn
2020-03-06 16:20:29 +00:00
bcc .3
2021-05-04 17:31:21 +00:00
jsr BLISTX.SetBlkByte override ending 0, already allocated
2020-03-06 16:20:29 +00:00
clc
bra .1
2021-05-04 17:31:21 +00:00
.3 jsr BLISTX.AddByte
2019-03-18 06:53:20 +00:00
bcc .1
2019-03-14 16:51:02 +00:00
rts
2019-03-15 16:20:28 +00:00
2019-03-18 16:48:16 +00:00
.8 lda #0
2021-05-04 17:31:21 +00:00
jmp BLISTX.AddByte Add an extra 0 to stop Search here
2020-02-18 15:34:56 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.SetData jsr SLISTX.Select
2020-02-20 07:41:52 +00:00
2022-11-02 06:54:30 +00:00
jsr SLISTX.SkipKey
jsr SLISTX.CheckLen
2022-11-02 06:54:30 +00:00
jsr SLISTX.GetDataLen
2019-03-18 16:48:16 +00:00
2022-11-02 06:54:30 +00:00
lda SLISTX.DataLen
2019-03-18 16:48:16 +00:00
cmp ZPSListDataLen
bne .9
2022-11-02 06:54:30 +00:00
ldx SLISTX.DataLen+1
2019-03-18 16:48:16 +00:00
cpx ZPSListDataLen+1
bne .9
eor #$ff
2022-11-02 06:54:30 +00:00
sta SLISTX.nDataCnt
2019-03-18 16:48:16 +00:00
txa
eor #$ff
2022-11-02 06:54:30 +00:00
sta SLISTX.nDataCnt+1
2022-11-02 06:54:30 +00:00
.1 inc SLISTX.nDataCnt
2019-03-18 16:48:16 +00:00
bne .2
2022-11-02 06:54:30 +00:00
inc SLISTX.nDataCnt+1
2019-03-18 16:48:16 +00:00
beq .8
2021-05-04 17:31:21 +00:00
.2 jsr SHARED.FORPNTgn
jsr BLISTX.SetBlkByte
2019-03-18 16:48:16 +00:00
bra .1
.8 clc
rts
2019-03-18 16:48:16 +00:00
.9 lda #E.DATALEN
sec
2019-03-13 16:29:24 +00:00
rts
2020-02-18 15:34:56 +00:00
*--------------------------------------
SLISTX.CheckLen lda ZPSListDataLen
ora ZPSListDataLen+1
bne .8
2022-11-02 06:54:30 +00:00
tax ldx #0
tay ldy #0
lda FORPNT+1
pha
.1 jsr SHARED.FORPNTgY
beq .2
iny
bne .1
inc FORPNT+1
inx
bra .1
.2 iny add Ending \0
bne .3
inx
.3 sty ZPSListDataLen
stx ZPSListDataLen+1
pla
sta FORPNT+1
.8 rts
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.GetByID jsr SLISTX.Select
2021-05-04 17:31:21 +00:00
jsr BLISTX.GetNByte
tax
beq .9
ldy #0
2019-03-21 07:07:38 +00:00
.1 phy
2021-05-04 17:31:21 +00:00
jsr BLISTX.GetNByte
2019-03-21 07:07:38 +00:00
ply
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTpn
2020-02-18 15:34:56 +00:00
iny
dex
bne .1
2019-03-18 16:48:16 +00:00
txa lda #0
2020-02-18 15:34:56 +00:00
2022-11-02 06:54:30 +00:00
jsr SHARED.FORPNTpn ending \0
2022-11-02 06:54:30 +00:00
jsr BLISTX.GetNByte ScopeID lo
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTpn
2019-03-18 16:48:16 +00:00
2022-11-02 06:54:30 +00:00
jsr BLISTX.GetNByte ScopeID hi
jsr SHARED.FORPNTpn
jsr SLISTX.SkipData
2021-05-04 17:31:21 +00:00
>LDYA KeyID
2019-03-18 16:48:16 +00:00
clc
rts
2020-02-18 15:34:56 +00:00
2019-03-18 16:48:16 +00:00
.9 lda #E.NOKEY
sec
rts
2020-02-18 15:34:56 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.NewKey jsr SLISTX.Lookup
2019-03-14 16:51:02 +00:00
bcc .99
2020-02-18 15:34:56 +00:00
2021-05-04 17:31:21 +00:00
>LDYA KeyID
2022-11-02 06:54:30 +00:00
>STYA SLISTX.KeyID End of list
2022-11-02 06:54:30 +00:00
lda SLISTX.KeyLen
2021-05-04 17:31:21 +00:00
jsr BLISTX.SetBlkByte override ending 0, already allocated
2020-02-18 15:34:56 +00:00
2019-03-14 16:51:02 +00:00
ldy #0
2020-02-18 15:34:56 +00:00
2021-05-04 17:31:21 +00:00
.1 jsr SHARED.TXTPTRgY
jsr BLISTX.AddByte
2019-03-14 16:51:02 +00:00
bcs .9
2020-02-18 15:34:56 +00:00
2019-03-14 16:51:02 +00:00
iny
2022-11-02 06:54:30 +00:00
cpy SLISTX.KeyLen
2019-03-14 16:51:02 +00:00
bne .1
2020-02-18 15:34:56 +00:00
2022-11-02 06:54:30 +00:00
lda FORPNT
jsr BLISTX.AddByte ScopeID lo
bcs .9
lda FORPNT+1 ScopeID hi
jsr BLISTX.AddByte
bcs .9
2020-03-06 16:20:29 +00:00
lda #0 Data Len lo = 0
2021-05-04 17:31:21 +00:00
jsr BLISTX.AddByte
2019-03-14 16:51:02 +00:00
bcs .9
2020-02-18 15:34:56 +00:00
2020-03-06 16:20:29 +00:00
lda #0 Data Len hi = 0
2021-05-04 17:31:21 +00:00
jsr BLISTX.AddByte
2019-03-14 16:51:02 +00:00
bcs .9
2020-02-18 15:34:56 +00:00
2020-03-06 16:20:29 +00:00
lda #0 Ending Len = 0
2021-05-04 17:31:21 +00:00
jsr BLISTX.AddByte
2022-11-02 06:54:30 +00:00
bcc SLISTX.8
2019-03-13 16:29:24 +00:00
rts
2019-04-09 15:47:33 +00:00
.99 lda #E.DUPKEY
2019-03-14 16:51:02 +00:00
sec
2019-10-03 06:25:27 +00:00
.9 rts
2020-02-18 15:34:56 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.8 >LDYA SLISTX.KeyID
ldx SLISTX.KeyLen
clc
rts
2019-07-29 15:38:55 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.Lookup jsr K.GetMemPtr
2021-05-04 17:31:21 +00:00
>STYA IBlkPtr
lda (IBlkPtr)
2022-11-02 06:54:30 +00:00
sta SLISTX.Opt
stz iByte
ldy #1
sty iBlk
lda (IBlkPtr),y
2018-06-21 15:12:10 +00:00
jsr K.GetMemPtr
2021-05-04 17:31:21 +00:00
>STYA DBlkPtr
2020-02-18 15:34:56 +00:00
2019-03-14 16:51:02 +00:00
ldy #$ff
2019-03-14 16:51:02 +00:00
.1 iny
2021-05-04 17:31:21 +00:00
jsr SHARED.TXTPTRgY
beq .2
2020-02-20 07:41:52 +00:00
2022-11-02 06:54:30 +00:00
jsr SLISTX.IsIDValid
2019-03-14 16:51:02 +00:00
bcc .1
2022-11-02 06:54:30 +00:00
.2 sty SLISTX.KeyLen
2020-02-18 15:34:56 +00:00
.3 >LDYA KeyID
2022-11-02 06:54:30 +00:00
>STYA SLISTX.KeyID
2021-05-04 17:31:21 +00:00
ldy iByte
lda (DBlkPtr),y
2019-03-18 16:48:16 +00:00
beq .9
2020-02-18 15:34:56 +00:00
2022-11-02 06:54:30 +00:00
cmp SLISTX.KeyLen
bne .6
2021-05-04 17:31:21 +00:00
jsr BLISTX.GetNByte Skip Len
2020-02-18 15:34:56 +00:00
2019-03-14 16:51:02 +00:00
ldy #0
2020-02-18 15:34:56 +00:00
.4 phy
2021-05-04 17:31:21 +00:00
jsr BLISTX.GetNByte
sta .5+1
2019-03-18 06:53:20 +00:00
ply
2021-05-04 17:31:21 +00:00
jsr SHARED.TXTPTRgY
.5 cmp #$ff SELF MODIFIED
bne .6
2019-03-14 16:51:02 +00:00
iny
2022-11-02 06:54:30 +00:00
cpy SLISTX.KeyLen
bne .4
2020-02-18 15:34:56 +00:00
2022-11-02 06:54:30 +00:00
jsr SLISTX.GetDataLen Get Scope
cmp FORPNT+1
bne .6
2022-11-02 06:54:30 +00:00
lda FORPNT
cmp SLISTX.DataLen
beq SLISTX.8
2020-02-18 15:34:56 +00:00
2022-11-02 06:54:30 +00:00
.6 >LDYA SLISTX.KeyID
2022-11-02 06:54:30 +00:00
jsr SLISTX.Select.I move back...
jsr SLISTX.SkipKey
2022-11-02 06:54:30 +00:00
jsr SLISTX.SkipData
bra .3
2020-02-18 15:34:56 +00:00
2019-03-14 16:51:02 +00:00
.9 lda #E.NOKEY
sec
rts
*--------------------------------------
2022-11-02 06:54:30 +00:00
* PRIVATE
*--------------------------------------
SLISTX.Select jsr K.GetMemPtr
2021-05-04 17:31:21 +00:00
>STYA IBlkPtr
2019-03-28 16:48:22 +00:00
2020-02-20 07:41:52 +00:00
>LDYA TXTPTR
2022-11-02 06:54:30 +00:00
SLISTX.Select.I >STYA KeyID
2020-02-20 07:41:52 +00:00
2021-05-04 17:31:21 +00:00
ldy iBlk
2020-02-18 15:34:56 +00:00
2021-05-04 17:31:21 +00:00
lda (IBlkPtr),y
2019-03-28 16:48:22 +00:00
jsr K.GetMemPtr
2021-05-04 17:31:21 +00:00
>STYA DBlkPtr
2020-02-18 15:34:56 +00:00
2019-03-28 16:48:22 +00:00
rts
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.SkipKey ldy iByte
lda (DBlkPtr),y Get KeyLen
sec len
inc
inc Skip ScopeID
adc iByte
sta iByte
bcc .8
jmp BLISTX.2NBlk
2019-03-15 16:20:28 +00:00
2022-11-02 06:54:30 +00:00
.8 rts
*--------------------------------------
SLISTX.SkipData jsr SLISTX.GetDataLen
2022-11-02 06:54:30 +00:00
lda SLISTX.DataLen
ldx SLISTX.DataLen+1
SLISTX.SkipDataAX
2019-03-15 16:20:28 +00:00
clc
2021-05-04 17:31:21 +00:00
adc iByte
sta iByte
2019-03-15 16:20:28 +00:00
txa
2021-05-04 17:31:21 +00:00
adc iBlk
sta iBlk
2019-03-18 06:53:20 +00:00
tay
2021-05-04 17:31:21 +00:00
lda (IBlkPtr),y
2019-03-15 16:20:28 +00:00
jsr K.GetMemPtr
2021-05-04 17:31:21 +00:00
>STYA DBlkPtr
2019-03-15 16:20:28 +00:00
rts
2019-03-14 16:51:02 +00:00
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.GetDataLen
2021-05-04 17:31:21 +00:00
jsr BLISTX.GetNByte Get DataLenLo
2022-11-02 06:54:30 +00:00
sta SLISTX.DataLen
2021-05-04 17:31:21 +00:00
jsr BLISTX.GetNByte Get DataLenHI
2022-11-02 06:54:30 +00:00
sta SLISTX.DataLen+1
2019-03-15 16:20:28 +00:00
rts
*--------------------------------------
2022-11-02 06:54:30 +00:00
SLISTX.IsIDValid
bit SLISTX.Opt SL..
bpl .2
cmp #'.'
beq .8
.1 bit SLISTX.Opt SL._
.2 bvc .3
cmp #'_'
beq .8
.3 jmp SHARED.IsDigitOrL
.8 clc
rts
*--------------------------------------
MAN
2020-12-15 13:23:22 +00:00
SAVE usr/src/sys/kernel.s.slistx
LOAD usr/src/sys/kernel.s
ASM