Kernel 0.92+

This commit is contained in:
Rémy GIBERT 2019-03-13 16:29:24 +00:00
parent c0c16c4215
commit 5ed5171f8b
8 changed files with 118 additions and 42 deletions

Binary file not shown.

View File

@ -532,8 +532,37 @@ CMD.RD lda (ZPArgVBufPtr)
.9 jmp CMD.Exec.CSYN
*--------------------------------------
CMD.FUNC
CMD.FUNC lda (ZPArgVBufPtr)
beq .9
jsr CORE.StkGetCtx
bcc .9 NO context allowed
>LDA.G hFuncList
bne .1
>SYSCALL SListNew
bcs .9
>STA.G hFuncList
.1 >PUSHW ZPArgVBufPtr
>LDA.G hFuncList
>SYSCALL SListNewKey
bcs .99
phy
jsr CORE.StkPush
ply
bcs .99
tya
jsr CORE.StkPush
bcs .99
lda #$C0+C.FUNC
jmp CORE.StkPush
.9 jmp CMD.Exec.CSYN
.99 rts
*--------------------------------------
CMD.RETURN
.9 jmp CMD.Exec.CSYN
@ -586,6 +615,8 @@ CMD.CASE jsr CORE.StkGetCtx Get context in CORE.Test
bcs .9
tax
and #$3F
cmp #C.SWITCH
beq .1
@ -593,7 +624,14 @@ CMD.CASE jsr CORE.StkGetCtx Get context in CORE.Test
cmp #C.CASE
bne .9
jsr CORE.StkPull remove C.CASE
txa previous case was true ?
bpl .10
jsr EXP.GET skip expression
bcs .9
rts keep existing context
.10 jsr CORE.StkPull remove previous C.CASE
bra CMD.CASE
.1 jsr EXP.GET
@ -639,6 +677,9 @@ CMD.END jsr CORE.StkGetCtx Get context in CORE.Test
bcs CMD.END.CSYN
and #$3F
cmp #C.FUNC
beq .3
cmp #C.SWITCH
beq .2
@ -655,6 +696,10 @@ CMD.END jsr CORE.StkGetCtx Get context in CORE.Test
>SYSCALL freemem
rts
.3 jsr CORE.StkPull remove C.FUNC
jsr CORE.StkPull remove KeyID
jmp CORE.StkPull remove KeyID
CMD.END.CSYN jmp CMD.Exec.CSYN
*--------------------------------------
CMD.FOR jsr CORE.StkGetCtx
@ -704,10 +749,11 @@ FOR.LIST sec
bcs .99
phy
jsr CORE.StkPush Push hLIST
jsr CORE.StkPush Push listPtr
ply
bcs .99
pla
jsr CORE.StkPush Push hLIST
tya
jsr CORE.StkPush Push listptr
bcs .99
txa

View File

@ -9,9 +9,15 @@ CORE.Init >LDYAI 256
>STYA ZPArgVBuf
txa
>STA.G CORE.hArgVBuf
.9 rts
*--------------------------------------
CORE.Quit >LDA.G CORE.hArgVBuf
CORE.Quit >LDA.G hFuncList
beq .1
>SYSCALL SListFree
.1 >LDA.G CORE.hArgVBuf
beq .9
>SYSCALL FreeMem
@ -86,7 +92,7 @@ CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping
.3 cmp #C.CR
beq .80 empty line ?
.10 cmp #'#' commented line?
cmp #'#' commented line?
bne .2
.12 jsr CORE.GetNextCharNB
@ -103,7 +109,18 @@ CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping
clc
.9 rts EOL, CS,A=0
.2 cmp #'.'
.2 jsr CORE.StkGet
bcs .13
cmp #$C0+C.FUNC
beq .12
.13 jsr CORE.GetCharNB
cmp #'.'
bne .4
ldy #1

View File

@ -685,6 +685,7 @@ DS.START
CORE.STACK .BS CORE.STACK.MAX+1 pData (0 = Stack Ptr)
PUSHD.STACK .BS PUSHD.STACK.MAX+1
hFuncList .BS 1
hInputBuf .BS 1
bReadMode .BS 1

View File

@ -290,7 +290,7 @@ SYS.SListGetData .EQ $F2
SYS.SListSetData .EQ $F4
SYS.SListGetByID .EQ $F6
SYS.SListAddKey .EQ $F8
SYS.SListNewKey .EQ $F8
SYS.SListLookup .EQ $FA
SYS.SListNew .EQ $FC
SYS.SListFree .EQ $FE

View File

@ -151,7 +151,7 @@ K.SYSCALL.JMP .DA K.GetMemStat $00
.DA K.SListSetData
.DA K.SListGetByID
.DA K.SListAddKey
.DA K.SListNewKey
.DA K.SListLookup
.DA K.SListNew
.DA K.SListFree

View File

@ -394,6 +394,7 @@ MEM.GetMemByID sta ZPMemMgrSPtr
* ## RETURN VALUE
* Y,A = Next DataID
*\--------------------------------------
K.SListAddData
*/--------------------------------------
* # SListGetData
* ## ASM
@ -404,6 +405,7 @@ MEM.GetMemByID sta ZPMemMgrSPtr
* ## RETURN VALUE
* Y,A = Next DataID
*\--------------------------------------
K.SListGetData
*/--------------------------------------
* # SListSetData
* ## ASM
@ -414,8 +416,6 @@ MEM.GetMemByID sta ZPMemMgrSPtr
* ## RETURN VALUE
* Y,A = Next DataID
*\--------------------------------------
K.SListAddData
K.SListGetData
K.SListSetData pha
>PULLW ZPSListID
bra K.SListPullA
@ -434,16 +434,15 @@ K.SListGetByID pha
>PULLW ZPSListKeyPtr
bra K.SListPullA
*/--------------------------------------
* # SListAddKey
* # SListNewKey
* ## ASM
* `PUSHW KeyPtr`
* `lda hSList`
* `>SYSCALL SListAddKey`
* `>SYSCALL SListNewKey`
* ## RETURN VALUE
* A = Key Length
* X,Y = KeyID
* Y,A = KeyID
*\--------------------------------------
K.SListAddKey
K.SListNewKey
*/--------------------------------------
* # SListLookup
* ## ASM

View File

@ -3,14 +3,16 @@ PREFIX
AUTO 4,1
*--------------------------------------
X.SLIST jmp (.1-SYS.SListAddData,x)
.1 .DA SLIST.Add
.DA SLIST.Lookup
.1 .DA SLIST.AddData
.DA SLIST.GetData
.DA SLIST.SetData
.DA SLIST.GetByID
.DA SLIST.UpdateByID
.DA SLIST.NewKey
.DA SLIST.Lookup
.DA SLIST.New
.DA SLIST.Free
*--------------------------------------
SLIST.Add jsr SLIST.Search
SLIST.AddData jsr SLIST.Search
bcc .99 Lookup succeeded...DUP
ldy #$ff
@ -60,28 +62,13 @@ SLIST.Add jsr SLIST.Search
ldy ZPSListID+1
.9 rts
*--------------------------------------
SLIST.Lookup jsr SLIST.Search
bcs .9
sty .8+1 Save Key Length
jsr SLIST.GetBlockByte
tax
jsr MEM.SetDataByte
.1 jsr SLIST.GetNextBlockByte
jsr MEM.SetDataByte
dex
bne .1
.8 lda #$ff SELF MODIFIED
ldx ZPSListID
ldy ZPSListID+1
SLIST.GetData
*--------------------------------------
SLIST.SetData
clc
.9 rts
rts
*--------------------------------------
SLIST.GetByID jsr SLIST.Select
@ -120,6 +107,10 @@ SLIST.GetByID jsr SLIST.Select
ldy SLIST.IndexOfs
rts
*--------------------------------------
SLIST.NewKey
clc
rts
*--------------------------------------
SLIST.UpdateByID
jsr SLIST.Select
@ -145,6 +136,28 @@ SLIST.UpdateByID
clc
rts
*--------------------------------------
SLIST.Lookup jsr SLIST.Search
bcs .9
sty .8+1 Save Key Length
jsr SLIST.GetBlockByte
tax
jsr MEM.SetDataByte
.1 jsr SLIST.GetNextBlockByte
jsr MEM.SetDataByte
dex
bne .1
.8 lda #$ff SELF MODIFIED
ldx ZPSListID
ldy ZPSListID+1
clc
.9 rts
*--------------------------------------
SLIST.New >LDYAI 160 40k Max before out of memory!!!
jsr K.GetMem0
bcs .9