A2osX/SYS/KERNEL.S.BLISTX.txt

111 lines
1.8 KiB
Plaintext
Raw Normal View History

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
*--------------------------------------
BLISTX.New >LDYAI 128 32k Max before out of memory!!!
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
2021-04-29 11:56:34 +00:00
lda #0
2021-05-04 17:31:21 +00:00
sta (DBlkPtr)
2021-04-29 11:56:34 +00:00
txa
2021-05-04 17:31:21 +00:00
sta (IBlkPtr)
2021-04-29 11:56:34 +00:00
.8 lda #$ff SELF MODIFIED
.9 rts
*--------------------------------------
BLISTX.Free pha
jsr K.GetMemPtr
>STYA .1+1
ldx #0
.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