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