Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2020-01-14 08:40:01 +01:00
parent 30ddc5d5da
commit 8ba8817cc1
4 changed files with 51 additions and 7 deletions

Binary file not shown.

View File

@ -2,6 +2,7 @@ NEW
AUTO 3,1
*--------------------------------------
AUXPIPE .EQ 1
AUXENV .EQ 0
*--------------------------------------
ZPKERNEL .EQ $0
*--------------------------------------

View File

@ -239,16 +239,20 @@ ENV.Search.YA >STYA .4+1
K.PutEnv >STYA ZPPtr2 NAME=VALUE
ldy #0
.1 lda (ZPPtr2),y copy NAME to K.Buf256
beq .9
cmp #'='
beq .2
sta K.Buf256,y
iny
bne .1
.9 lda #E.SYN
sec
rts
.2 lda #0
sta K.Buf256,y
@ -277,6 +281,7 @@ K.SetEnv.I jsr K.UnsetEnv.I
lda #1
sta ZPPtr4
stz ZPPtr4+1 ZPPtr4 = ENVSIZE = 1
.10 lda (ZPPtr3) End of ENV
beq .15
jsr ENV.GetP3LenY
@ -285,9 +290,11 @@ K.SetEnv.I jsr K.UnsetEnv.I
bra .10
.15 ldy #$ff
.16 iny
lda (ZPPtr1),y
bne .16
jsr ENV.NextEnvP4Y ZPPtr4 = ENVSIZE + VAR
ldy #$ff
@ -295,10 +302,13 @@ K.SetEnv.I jsr K.UnsetEnv.I
.19 iny
lda (ZPPtr2),y
bne .19
jsr ENV.NextEnvP4Y ZPPtr4 = ENVSIZE + VALUE
lda ZPPtr4
beq .20
inc ZPPtr4+1
.20 ldy #S.PS.ENVPAGECNT
lda (pPs),y
cmp ZPPtr4+1
@ -307,6 +317,7 @@ K.SetEnv.I jsr K.UnsetEnv.I
lda ZPPtr4+1
jsr ENV.Dup.A
bcs .9
pha
ldy #S.PS.hENV
lda (pPs),y
@ -318,11 +329,14 @@ K.SetEnv.I jsr K.UnsetEnv.I
dey S.PS.ENVPAGECNT
sta (pPs),y
bra .1 Start over
.22 ldy #$ff
.23 iny
lda (ZPPtr1),y
sta (ZPPtr3),y
bne .23
jsr ENV.NextEnvP3Y
ldy #$ff
@ -352,8 +366,10 @@ K.SetEnv.I jsr K.UnsetEnv.I
K.GetEnv >STYA ZPPtr1
jsr ENV.FindVarP1
bcs .9
jsr ENV.NextEnvP3 Skip NAME
clc just in case ADC in NextEnvPtr3 disturb CC
.9 >LDYA ZPPtr3 \0
rts
*/--------------------------------------
@ -551,7 +567,12 @@ ENV.DelVarP3 >LDYA ZPPtr3 save actual Ptr
*--------------------------------------
ENV.InitEnvP3 ldy #S.PS.hENV
lda (pPs),y
.DO AUXENV=1
ldx #SYS.GetStkObjPtr
jsr K.SYSCALL2
.ELSE
jsr K.GetMemPtr
.FIN
>STYA ZPPtr3 Store ENV
ENV.InitEnvP3.RTS
rts
@ -609,31 +630,48 @@ ENV.AddAToBuf ldx ENV.BufLen
*--------------------------------------
ENV.Dup ldy #S.PS.ENVPAGECNT
lda (pPs),y
ENV.Dup.A sta .8+1 Store target page Count
ldy #0
jsr K.GetMem
bcs .9
>STYA .2+1 Target Buffer
phx save hMem
jsr Mem.SetOwner Set Ownership
ldy #S.PS.hENV
lda (pPs),y
jsr K.GetMemPtr
>STYA .1+1
ldy #S.PS.ENVPAGECNT get SOURCE page count
lda (pPs),y
tax
iny #S.PS.hENV
lda (pPs),y
.DO AUXENV=1
sta SETREADAUX
sta SETWRITEAUX
.FIN
jsr K.GetMemPtr
>STYA .1+1
ldy #0
.1 lda $ffff,y SELF MODIFIED
.2 sta $ffff,y SELF MODIFIED
iny
bne .1
inc .1+2
inc .2+2
dex
bne .1
.8 ldx #$ff SELF MODIFIED Target Page Count
.8 .DO AUXENV=1
sta CLRREADAUX
sta CLRWRITEAUX
.FIN
ldx #$ff SELF MODIFIED Target Page Count
pla hMem
clc
.9 rts

View File

@ -1000,7 +1000,12 @@ TskMgrInit >LDYAI MSG.TSK
>SYSCALL2 puts
>LDYAI K.ENV.SIZE get a buffer for ENV
.DO AUXENV=1
ldx #SYS.NewStkObj
jsr K.SYSCALL2.AUX Buffer in AUX mem
.ELSE
jsr K.GetMem
.FIN
bcs EvtMgrInit.RTS
>STYA ZPPtr1
ldy #S.PS.ENVPAGECNT
@ -1008,8 +1013,8 @@ TskMgrInit >LDYAI MSG.TSK
sta (pPs),y
txa
* ldy #S.PS.hENV
iny
iny #S.PS.hENV
sta (pPs),y
lda #0
sta (ZPPtr1) make sure blank!!