2021-04-29 11:56:34 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
IBlkPtr .EQ ZPMEMMGR+12
|
|
|
|
|
DBlkPtr .EQ ZPMEMMGR+14
|
2021-04-29 11:56:34 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
KeyID .EQ *
|
|
|
|
|
iByte .BS 1
|
|
|
|
|
iBlk .BS 1
|
2021-04-29 11:56:34 +00:00
|
|
|
|
*--------------------------------------
|
2022-11-02 06:54:30 +00:00
|
|
|
|
BLISTX.New sta SLISTX.Opt
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
|
|
|
|
>LDYAI 128 32k Max before out of memory!!!
|
2021-04-29 11:56:34 +00:00
|
|
|
|
ldx #S.MEM.F.INIT0+8 index
|
|
|
|
|
jsr MEM.GetMem.YAX
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
>STYA IBlkPtr
|
2021-04-29 11:56:34 +00:00
|
|
|
|
stx .8+1
|
|
|
|
|
|
|
|
|
|
>LDYAI 256
|
|
|
|
|
ldx #4 data
|
|
|
|
|
jsr MEM.GetMem.YAX
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
>STYA DBlkPtr
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
lda #0
|
2021-05-04 17:31:21 +00:00
|
|
|
|
sta (DBlkPtr)
|
2022-09-17 11:35:52 +00:00
|
|
|
|
|
2022-11-02 06:54:30 +00:00
|
|
|
|
lda SLISTX.Opt
|
2021-05-04 17:31:21 +00:00
|
|
|
|
sta (IBlkPtr)
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #1
|
|
|
|
|
sta (IBlkPtr),y
|
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.8 lda #$ff SELF MODIFIED
|
2022-09-17 11:35:52 +00:00
|
|
|
|
* clc
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
BLISTX.Free pha
|
|
|
|
|
|
|
|
|
|
jsr K.GetMemPtr
|
|
|
|
|
>STYA .1+1
|
|
|
|
|
|
2022-09-17 11:35:52 +00:00
|
|
|
|
ldx #1
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
|
|
|
|
.1 lda $ffff,x SELF MODIFIED
|
|
|
|
|
beq .8
|
|
|
|
|
|
2021-05-19 12:44:47 +00:00
|
|
|
|
phx
|
2021-04-29 11:56:34 +00:00
|
|
|
|
jsr K.FreeMem
|
2021-05-19 12:44:47 +00:00
|
|
|
|
|
|
|
|
|
plx
|
2021-04-29 11:56:34 +00:00
|
|
|
|
inx
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 pla
|
|
|
|
|
jmp K.FreeMem
|
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
BLISTX.GetNByte ldy iByte
|
|
|
|
|
lda (DBlkPtr),y
|
|
|
|
|
|
|
|
|
|
BLISTX.2NByte inc iByte
|
2021-04-29 11:56:34 +00:00
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
pha
|
2021-05-04 17:31:21 +00:00
|
|
|
|
jsr BLISTX.2NBlk
|
2021-04-29 11:56:34 +00:00
|
|
|
|
pla
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
BLISTX.AddByte phy
|
|
|
|
|
ldy iByte
|
|
|
|
|
sta (DBlkPtr),y
|
|
|
|
|
inc iByte
|
2021-04-29 11:56:34 +00:00
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
phx
|
|
|
|
|
>LDYAI 256
|
|
|
|
|
ldx #4
|
|
|
|
|
jsr MEM.GetMem.YAX
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
>STYA DBlkPtr
|
2021-04-29 11:56:34 +00:00
|
|
|
|
txa
|
2021-05-04 17:31:21 +00:00
|
|
|
|
inc iBlk
|
|
|
|
|
ldy iBlk
|
|
|
|
|
sta (IBlkPtr),y
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
* stz iByte
|
2021-04-29 11:56:34 +00:00
|
|
|
|
plx
|
|
|
|
|
|
|
|
|
|
.8 ply
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 plx
|
|
|
|
|
ply
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
BLISTX.SetBlkByte
|
|
|
|
|
ldy iByte
|
|
|
|
|
sta (DBlkPtr),y
|
|
|
|
|
inc iByte
|
|
|
|
|
bne BLISTX.RTS
|
2021-04-29 11:56:34 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
BLISTX.2NBlk inc iBlk
|
|
|
|
|
ldy iBlk
|
|
|
|
|
lda (IBlkPtr),y
|
2021-04-29 11:56:34 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2021-05-04 17:31:21 +00:00
|
|
|
|
>STYA DBlkPtr
|
|
|
|
|
BLISTX.RTS rts
|
2021-04-29 11:56:34 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/sys/kernel.s.blistx
|
|
|
|
|
LOAD usr/src/sys/kernel.s
|
|
|
|
|
ASM
|