mirror of
https://github.com/A2osX/A2osX.git
synced 2025-03-24 09:33:48 +00:00
Kernel 0.93+
This commit is contained in:
parent
ad6a4da9a4
commit
3cab630f23
Binary file not shown.
@ -18,9 +18,13 @@ ENV.hMem .BS 1
|
||||
ENV.bExp .BS 1
|
||||
.ED
|
||||
*--------------------------------------
|
||||
K.ExpandStr stz ENV.hMem Reset Intermediate string...
|
||||
K.ExpandStr jsr K.strdup
|
||||
bcc .1
|
||||
|
||||
.1 >STYA TXTPTR
|
||||
rts
|
||||
|
||||
.1 stx ENV.hMem Intermediate string...
|
||||
>STYA TXTPTR
|
||||
|
||||
stz ENV.BufLen init Expanded String len=0
|
||||
stz ENV.bExp No var found yet
|
||||
@ -95,7 +99,7 @@ K.ExpandStr stz ENV.hMem Reset Intermediate string...
|
||||
bcs .70
|
||||
|
||||
jsr ENV.NextEnvP3Y Skip NAME=
|
||||
jsr ENV.AddP3ToBuf
|
||||
jsr ENV.AddP3ToBuf Add VALUE
|
||||
|
||||
.70 lda (TXTPTR)
|
||||
beq .72
|
||||
@ -110,22 +114,23 @@ K.ExpandStr stz ENV.hMem Reset Intermediate string...
|
||||
|
||||
bra .35 skip "}" and loop
|
||||
|
||||
.80 lda ENV.hMem working from our temp string ?
|
||||
beq .81 no...
|
||||
jsr K.FreeMem yes, discard....
|
||||
|
||||
.81 ldx ENV.BufLen
|
||||
.80 ldx ENV.BufLen
|
||||
stz K.Buf256,x
|
||||
|
||||
>LDYAI K.Buf256
|
||||
lda ENV.hMem
|
||||
jsr K.FreeMem
|
||||
|
||||
>LDYAI K.Buf256 dup in case of '' processing
|
||||
jsr K.strdup
|
||||
bcs K.FileSearch.RTS
|
||||
|
||||
stx ENV.hMem save this as temp string, in case of recurse
|
||||
bcs .9
|
||||
|
||||
bit ENV.bExp Did we expand something ?
|
||||
bpl K.FileSearch.RTS No, exit with Y,A from STRDUP
|
||||
|
||||
jmp .1 Yes, start over with ENV.hMem
|
||||
bpl .9
|
||||
|
||||
jmp .1
|
||||
|
||||
* clc
|
||||
.9 rts
|
||||
*/--------------------------------------
|
||||
* # FileSearch
|
||||
* Search a file in the provided PATH list
|
||||
@ -193,20 +198,12 @@ ENV.Search.PATH ldx #4
|
||||
ENV.Search.Ptr2 >LDYA ZPPtr2
|
||||
ENV.Search.YA >STYA .4+1
|
||||
|
||||
* >LDYA ENV.SearchPath
|
||||
* jsr K.ExpandStr Y,A = Search Path, Expand it
|
||||
* bcs ENV.Search.98
|
||||
|
||||
* >STYA .2+1 expanded search list ;
|
||||
* stx ENV.Search.97+1
|
||||
|
||||
stz .1+1
|
||||
|
||||
.1 ldy #$0 Self Modified Index in Search list string
|
||||
.1 ldy #0 Self Modified Index in Search list string
|
||||
|
||||
ldx #$0
|
||||
ldx #0
|
||||
|
||||
*.2 lda $ffff,y Self Modified, Search list string
|
||||
.2 lda (ENV.SearchPath),y
|
||||
|
||||
beq .3 end of string, try it....
|
||||
@ -220,11 +217,11 @@ ENV.Search.YA >STYA .4+1
|
||||
bra .2
|
||||
|
||||
.3 txa
|
||||
beq ENV.Search.97 String is empty....nothing to try
|
||||
beq ENV.Search.98 String is empty....nothing to try
|
||||
|
||||
sty .1+1 save current index
|
||||
|
||||
ldy #$0
|
||||
ldy #0
|
||||
|
||||
.4 lda $ffff,y Self Modified, Append Filename...
|
||||
sta K.Buf256,x
|
||||
@ -238,19 +235,15 @@ ENV.Search.YA >STYA .4+1
|
||||
>LDYAI K.Buf256
|
||||
>SYSCALL2 stat
|
||||
bcs .1 Failed...retry next path...
|
||||
|
||||
|
||||
lda K.S.STAT+S.STAT.P.TYPE
|
||||
cmp #S.FI.T.DIR Dir ?
|
||||
beq .1
|
||||
jsr ENV.Search.97 Discard Expanded hSrch list
|
||||
jsr ENV.Search.98 Discard Expanded hSrch list
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
ENV.Search.97
|
||||
* lda #$ff SELF MODIFIED : Discard Expanded Search list
|
||||
* jsr K.FreeMem
|
||||
|
||||
ENV.Search.98 lda #$ff SELF MODIFIED : Discard Search list
|
||||
jsr K.FreeMem
|
||||
|
||||
@ -268,11 +261,11 @@ ENV.Search.98 lda #$ff SELF MODIFIED : Discard Search list
|
||||
* `>SYSCALL putenv`
|
||||
* ## RETURN VALUE
|
||||
*\--------------------------------------
|
||||
K.PutEnv >STYA ZPPtr2 NAME=VALUE
|
||||
K.PutEnv >STYA FORPNT NAME=VALUE
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 lda (ZPPtr2),y copy NAME to K.Buf256
|
||||
.1 lda (FORPNT) copy NAME to K.Buf256
|
||||
beq .9
|
||||
|
||||
cmp #'='
|
||||
@ -280,7 +273,11 @@ K.PutEnv >STYA ZPPtr2 NAME=VALUE
|
||||
|
||||
sta K.Buf256,y
|
||||
iny
|
||||
|
||||
inc FORPNT
|
||||
bne .1
|
||||
inc FORPNT+1
|
||||
bra .1
|
||||
|
||||
.9 lda #E.SYN
|
||||
sec
|
||||
@ -288,10 +285,12 @@ K.PutEnv >STYA ZPPtr2 NAME=VALUE
|
||||
|
||||
.2 lda #0
|
||||
sta K.Buf256,y
|
||||
|
||||
inc FORPNT
|
||||
bne .3
|
||||
inc FORPNT+1
|
||||
|
||||
jsr SHARED.AddYp1ToPtr2
|
||||
|
||||
>LDYAI K.Buf256
|
||||
.3 >LDYAI K.Buf256
|
||||
>STYA TXTPTR
|
||||
bra K.SetEnv.I
|
||||
*/--------------------------------------
|
||||
@ -335,7 +334,7 @@ K.SetEnv.I jsr K.UnsetEnv.I
|
||||
ldy #$ff
|
||||
|
||||
.19 iny
|
||||
lda (ZPPtr2),y
|
||||
lda (FORPNT),y
|
||||
bne .19
|
||||
|
||||
jsr ENV.NextEnvP4Y ZPPtr4 = ENVSIZE + VALUE
|
||||
|
Loading…
x
Reference in New Issue
Block a user