Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2020-01-15 17:43:23 +01:00
parent 18f8a90a78
commit 8edb2d0580
3 changed files with 49 additions and 34 deletions

View File

@ -20,15 +20,17 @@ ENV.bExp .BS 1
*--------------------------------------
K.ExpandStr stz ENV.hMem Reset Intermediate string...
.1 >STYA ZPPtr1
.1 >STYA TXTPTR
stz ENV.BufLen init Expanded String len=0
stz ENV.bExp No var found yet
stz ENV.bNoExp Reset no expand flag
.10 jsr SHARED.GetCharPtr1 End of CSTR?
.10 lda (TXTPTR) End of CSTR?
beq .80
jsr SHARED.TXTPTR.Next
.11 cmp #'''
bne .21
@ -47,7 +49,7 @@ K.ExpandStr stz ENV.hMem Reset Intermediate string...
bne .22 no, store...
ror ENV.bExp Toggle Expanded flag
lda (ZPPtr1)
lda (TXTPTR)
bne .30
lda #'$' End of string, output $
@ -59,7 +61,7 @@ K.ExpandStr stz ENV.hMem Reset Intermediate string...
dec ENV.VarEndChar "}" expected
jsr SHARED.NextCharPtr1 skip "{"
jsr SHARED.TXTPTR.Next skip "{"
bra .40
.31 jsr ZP.IsDigit $0 ... $9 ?
@ -83,27 +85,27 @@ K.ExpandStr stz ENV.hMem Reset Intermediate string...
bra .40
.34 jsr ENV.SysVar
.35 jsr SHARED.NextCharPtr1 skip $x
.35 jsr SHARED.TXTPTR.Next skip $x
bra .10
.40 jsr ENV.ExpandStrVar
bcc .70
.50 jsr ENV.FindVarP1
.50 jsr ENV.FindVarTXTPTR
bcs .70
jsr ENV.NextEnvP3Y Skip NAME=
jsr ENV.AddP3ToBuf
.70 ldy #$ff
.71 iny
lda (ZPPtr1),y
.70 lda (TXTPTR)
beq .72
jsr SHARED.IsIDValid
bcc .71
.72 jsr SHARED.AddYToPtr1
lda ENV.VarEndChar
bcs .72
jsr SHARED.TXTPTR.Next
bra .70
.72 lda ENV.VarEndChar
beq .10
bra .35 skip "}" and loop
@ -177,7 +179,8 @@ ENV.Search.PATH ldx #4
>STYA ENV.SearchPath
stx ENV.Search.98+1
>SYSCALL2 puts
>DEBUG
>LDYA ZPPtr2
ENV.Search.YA >STYA .4+1
@ -187,6 +190,7 @@ ENV.Search.YA >STYA .4+1
stx ENV.Search.97+1
>STYA .2+1 expanded search list ;
>SYSCALL2 puts
stz .1+1
.1 ldy #$0 Self Modified Index in Search list string
@ -276,7 +280,7 @@ K.PutEnv >STYA ZPPtr2 NAME=VALUE
jsr SHARED.AddYp1ToPtr2
>LDYAI K.Buf256
>STYA ZPPtr1
>STYA TXTPTR
bra K.SetEnv.I
*/--------------------------------------
* # SetEnv
@ -290,7 +294,9 @@ K.PutEnv >STYA ZPPtr2 NAME=VALUE
* `>SYSCALL setenv`
* ## RETURN VALUE
*\--------------------------------------
K.SetEnv jsr SHARED.SPtr1PPtr2
K.SetEnv >STYA TXTPTR name
>PULLW FORPNT value
K.SetEnv.I jsr K.UnsetEnv.I
.1 jsr ENV.InitEnvP3 ZPPtr3 -> Env
@ -309,7 +315,7 @@ K.SetEnv.I jsr K.UnsetEnv.I
.15 ldy #$ff
.16 iny
lda (ZPPtr1),y
lda (TXTPTR),y
bne .16
jsr ENV.NextEnvP4Y ZPPtr4 = ENVSIZE + VAR
@ -350,7 +356,7 @@ K.SetEnv.I jsr K.UnsetEnv.I
.22 ldy #$ff
.23 iny
lda (ZPPtr1),y
lda (TXTPTR),y
sta (ZPPtr3),y
bne .23
@ -361,7 +367,7 @@ K.SetEnv.I jsr K.UnsetEnv.I
ldy #$ff
.24 iny
lda (ZPPtr2),y
lda (FORPNT),y
sta (ZPPtr3),y
bne .24
@ -385,9 +391,9 @@ K.SetEnv.I jsr K.UnsetEnv.I
* CS : not found
*\--------------------------------------
K.GetEnv >PULLW FORPNT value
>PULLW ZPPtr1 name
>PULLW TXTPTR name
jsr ENV.FindVarP1
jsr ENV.FindVarTXTPTR
bcs .9
jsr ENV.NextEnvP3Y Skip NAME=
@ -424,8 +430,8 @@ K.GetEnv >PULLW FORPNT value
* `>SYSCALL unsetenv`
* ## RETURN VALUE
*\--------------------------------------
K.UnsetEnv >STYA ZPPtr1 Store VAR Name
K.UnsetEnv.I jsr ENV.FindVarP1
K.UnsetEnv >STYA TXTPTR name
K.UnsetEnv.I jsr ENV.FindVarTXTPTR
bcs K.UnsetEnv.I.8 not found, quit
jsr ENV.DelVarP3 Ptr3 -> NAME=VALUE
@ -482,21 +488,27 @@ ENV.ExpandStrVar
ldy #$ff
.2 iny
lda (ZPPtr1),y
lda (TXTPTR),y
beq .3
jsr SHARED.IsIDValid
bcs .3
cmp (ZPPtr3),y
beq .2
bra .4
.3 lda (ZPPtr3),y
bne .4
jmp (ENV.StrVarsJmp,x)
.4 inx
inx
jsr ENV.NextEnvP3
bra .1
.9 sec
rts
*--------------------------------------
@ -547,19 +559,20 @@ ENV.StrVarsSession
bra .1
.3 jmp ENV.AddP3ToBuf
*--------------------------------------
* ENV.FindVarP1
* ENV.FindVarTXTPTR
* In:
* ZPPtr1 -> NAME
* TXTPTR -> NAME
* Out:
* CC: Found
* Y = NAME len
* ZPPtr1 -> NAME
* TXTPTR -> NAME
* ZPPtr3 -> NAME=VALUE
* CS: Not Found
* ZPPtr1 -> NAME
* TXTPTR -> NAME
* ZPPtr3 -> PTR to Ending 0
*--------------------------------------
ENV.FindVarP1 jsr ENV.InitEnvP3 Store ENV
ENV.FindVarTXTPTR
jsr ENV.InitEnvP3 Store ENV
.1 lda (ZPPtr3)
beq .9 end of ENV
@ -567,11 +580,12 @@ ENV.FindVarP1 jsr ENV.InitEnvP3 Store ENV
ldy #$ff
.2 iny
lda (ZPPtr1),y
lda (TXTPTR),y
beq .3
jsr SHARED.IsIDValid
bcs .3
cmp (ZPPtr3),y
beq .2

View File

@ -31,7 +31,6 @@ K.ExecL sty .1+1
>PUSHYA
.1 ldy #$ff SELF MODIFIED
.2 lda #$ff SELF MODIFIED
jsr K.Str2StrV
bcs .9

View File

@ -90,11 +90,13 @@ SHARED.TXTPTR.GetNext
sta CLRREADAUX
lda (TXTPTR)
sta SETREADAUX
beq .9
beq SHARED.TXTPTR.Next.9
SHARED.TXTPTR.Next
inc TXTPTR
bne .9
bne SHARED.TXTPTR.Next.9
inc TXTPTR+1
.9 rts
SHARED.TXTPTR.Next.9
rts
*--------------------------------------
SHARED.SPtr1PPtr2
>STYA ZPPtr1