Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-10-26 16:46:11 +02:00
parent d3a431dd32
commit 62ee438acb
8 changed files with 65 additions and 60 deletions

Binary file not shown.

Binary file not shown.

View File

@ -39,7 +39,7 @@ L.MSG.LOAD .DA MSG.LOAD
CS.RUN ldy #S.PS.ARGC
lda (pPs),y
cmp #2
bne .9
bcc .9
lda #1 get PTR to ARG[1] (Driver name)
>SYSCALL ArgV

View File

@ -47,7 +47,10 @@ Cmd.Parse >STZ.G CMD.bCmd
lda (ZPCMDBuf)
beq .8
.1 >LDA.G CMD.bCmd
.1 cmp #'#' comment ?
beq .8 yes, ignore remaining
>LDA.G CMD.bCmd
bne .6 we already have Cmd, go check args
ldy #2
@ -245,18 +248,16 @@ Cmd.INT.CD ldx #1
.4 >STYA ZPCMDBuf
txa
>STA.G CMD.hCmdLine
**** MEMORY LEAK : CMD.hCmdLine not released
>STA.G CMD.hCmdLine
ldy #1
lda (ZPCMDBuf),y
beq .8 we have '/'
>PUSHEA.G CMD.Stat
>LDYA ZPCMDBuf
>SYSCALL STAT
bcs .9
bcs .90
>LDA.G CMD.Stat+S.STAT.P.TYPE
cmp #S.FI.T.DIR
@ -264,7 +265,7 @@ Cmd.INT.CD ldx #1
.8 >LDYA ZPCMDBuf
>SYSCALL NewStr
bcs .9
bcs .90
phx
ldy #S.PS.hPREFIX
@ -275,8 +276,14 @@ Cmd.INT.CD ldx #1
ldy #S.PS.hPREFIX
sta (pPs),y
jmp SetPWD
jsr SetPWD
.90 php
pla
>LDA.G CMD.hCmdLine
>SYSCALL FreeMem
pla
plp
.9 rts
*--------------------------------------
Cmd.Exec.ERRSYN lda #E.SYN
@ -336,7 +343,7 @@ Cmd.INT.SET ldx #1
.9 rts
*--------------------------------------
Cmd.INT.SETVAR >STYA ZPPTR1
>SYSCALL puts
lda (ZPPTR1)
cmp #'=' string is '=value' ?
beq .99 syntax error
@ -363,6 +370,7 @@ Cmd.INT.SETVAR >STYA ZPPTR1
sta (ZPPTR1),y
>LDYA ZPPTR1 String is "VAR"...
>DEBUG
>SYSCALL UnsetEnv
rts

View File

@ -186,7 +186,7 @@ CSH.Run jsr CL.RESET
>STA.G bCmdBufexec
>LDA.G bSET.X
* beq .80
beq .80
>PUSHW ZPCMDBuf
>PUSHBI 2

View File

@ -15,21 +15,15 @@ AUTO 4,1
*\--------------------------------------
ARG.bInQuote .BS 1
*--------------------------------------
K.Args2ArgV pha
>PULLW ZPPtr2 Get target buffer
pla
K.Args2ArgV.I jsr K.ExpandStr
K.Args2ArgV jsr K.ExpandStr
bcs .9
phy
pha
>SYSCALL puts
pla
ply
>STYA ZPPtr1
stx .80+1
>PULLW ZPPtr2 Get target buffer
ldx #0 Arg Count
stz ARG.bInQuote
@ -77,7 +71,9 @@ K.Args2ArgV.I jsr K.ExpandStr
pla get back Arg Count
* clc
.9 rts
rts
.9 >RET 2 Discard target buffer
*/--------------------------------------
* # ArgV
* ## ASM

View File

@ -586,18 +586,16 @@ ENV.FindVarP1 jsr ENV.InitEnvP3 Store ENV
.1 lda (ZPPtr3)
beq .9 end of ENV
ldy #0
ldy #$ff
.2 lda (ZPPtr1),y
.2 iny
lda (ZPPtr1),y
cmp (ZPPtr3),y
bne .3
ora #0
beq .8
iny
bne .2
.8 clc
rts
@ -647,14 +645,13 @@ ENV.InitEnvP3 ldy #S.PS.hENV
>STYA ZPPtr3 Store ENV
rts
*--------------------------------------
ENV.NextEnvP3 ldy #0
ENV.NextEnvP3 ldy #$ff
.1 lda (ZPPtr3),y
beq .2
iny
.1 iny
lda (ZPPtr3),y
bne .1
.2 tya
tya
sec
adc ZPPtr3
sta ZPPtr3
@ -672,7 +669,6 @@ ENV.AddAToBuf ldx ENV.BufLen
ENV.BufLen .BS 1
ENV.bNoExp .BS 1
ENV.VarLen .BS 1
ENV.VarNamePtr .BS 2
ENV.VarName .BS 16
*--------------------------------------
MAN

View File

@ -3,7 +3,7 @@ PREFIX /A2OSX.BUILD
AUTO 4,1
*--------------------------------------
PS.Flags .BS 1
PS.Args .BS 2
PS.ArgV .BS 2
*/--------------------------------------
* # ExecL
* ## C
@ -15,23 +15,34 @@ PS.Args .BS 2
* ## RETURN VALUE
* A = Child PSID
*\--------------------------------------
K.ExecL pha
lda #K.IOBuf
sta ZPPtr2
lda /K.IOBuf
sta ZPPtr2+1
pla
jsr K.Args2ArgV.I
bcc .1
>RET 1 discard flags
K.ExecL sty .1+1
sta .2+1
>PULLB PS.Flags
.1 >LDYAI K.IOBuf
phy
>LDYAI 256
jsr K.GetMem
bcs .99
stx .90+1
>STYA PS.ArgV
>PUSHYA
.1 ldy #$ff SELF MODIFIED
.2 lda #$ff SELF MODIFIED
jsr K.Args2ArgV
bcs .9
jsr PS.Exec
.9 php
pha
>SYSCALL puts
.90 lda #$ff SELF MODIFIED
jsr K.FreeMem
pla
ply
plp
.99 rts
*/--------------------------------------
* # ExecV
* ## C
@ -43,15 +54,15 @@ K.ExecL pha
* ## RETURN VALUE
* A = Child PSID
*\--------------------------------------
K.ExecV >STYA PS.Args
K.ExecV >STYA PS.ArgV
>PULLB PS.Flags
jsr PS.CreateChild Child S.PS at ZPPtr3
PS.Exec jsr PS.CreateChild Child S.PS at ZPPtr3
bcs .9
sta .8+1
>LDYA PS.Args
>LDYA PS.ArgV
jsr PS.DupArgs
ldy #S.PS.hARGV
@ -63,13 +74,7 @@ K.ExecV >STYA PS.Args
pla
>SYSCALL GetMemPtr
phy
pha
>SYSCALL puts
pla
ply
>DEBUG
jsr PS.Load
bcc .8