Kernel 0.92+

This commit is contained in:
Rémy GIBERT 2019-02-04 14:29:52 +00:00
parent 8e1da7eb9a
commit 9fb1e9b49d
5 changed files with 47 additions and 59 deletions

Binary file not shown.

View File

@ -334,10 +334,10 @@ CMD.TIME clc
bra .2
.1 >PUSHW L.FMT.TIME
.2 >LDYA ZPCLBuf
.2 >LEA.G StatBuf
>SYSCALL StrFTime
>LDYA ZPCLBuf
>LEA.G StatBuf
>SYSCALL puts
rts
*--------------------------------------

View File

@ -17,32 +17,19 @@ CORE.Quit >LDA.G CORE.hArgVBuf
.9 rts
*--------------------------------------
* Input : ZPCLBuf/ZPFileBufPtr
* Input : ZPCLBuf/ZPFileBuf
* Get Line from buf until ;, CR, \0 (EOL / EOF) -> ZPArgVBuf
*--------------------------------------
CORE.GetCmdFromFileBuf
>LDYA ZPFileBufPtr
>STYA ZPFileBufPtrBak
CORE.GetCmd >LDYA ZPInputBufPtr
>STYA ZPInputLinePtr
jsr CORE.GetCmd
bcs .9
>LDYA ZPPtr1
>STYA ZPFileBufPtr
.9 rts
CORE.GetCmdFromClBuf
>LDYA ZPCLBuf
CORE.GetCmd >STYA ZPPtr1
lda (ZPPtr1)
lda (ZPInputBufPtr)
beq .9
ldx #0 not in "
ldx #0 reset "" flag
ldy #0
.1 lda (ZPPtr1),y
.1 lda (ZPInputBufPtr),y
beq .7
cmp #C.CR
@ -52,7 +39,7 @@ CORE.GetCmd >STYA ZPPtr1
bne .2
txa
eor #$80 toggle " switch
eor #$80 toggle "" flag
tax
lda #'"'
@ -62,7 +49,7 @@ CORE.GetCmd >STYA ZPPtr1
bne .5
txa
beq .6
beq .6 not between ""
lda #';'
@ -80,10 +67,10 @@ CORE.GetCmd >STYA ZPPtr1
.7 clc
tya
adc ZPPtr1
sta ZPPtr1
adc ZPInputBufPtr
sta ZPInputBufPtr
bcc .8
inc ZPPtr1+1
inc ZPInputBufPtr+1
.8 lda #0
sta (ZPArgVBuf),y
@ -91,8 +78,7 @@ CORE.GetCmd >STYA ZPPtr1
clc
rts
.9 lda #C.EOF
sec
.9 sec A=0
rts
*--------------------------------------
* Input : ZPArgVBuf (String)
@ -123,14 +109,14 @@ CORE.Exec >PUSHW ZPArgVBuf
>SYSCALL Args2ArgV TOKENIZE CL in ZPArgVBuf
>STZ.G CL.CmdSep
lda (ZPArgVBufPtr) empty line ?
beq .80
cmp #'#' comment ?
beq .80
>STZ.G CL.CmdSep
*************** LOOP Cmd Arg
.10 lda #S.PS.F.HOLD+S.PS.F.DUPENV
@ -140,7 +126,8 @@ CORE.Exec >PUSHW ZPArgVBuf
cmp #'|'
bne .1
* PIPE
jsr IO.Pipe.In
bcs .90
*************** LOOP Token
@ -182,7 +169,8 @@ CORE.Exec >PUSHW ZPArgVBuf
>STA.G CL.CmdSep
* PIPE
jsr IO.Pipe.Out
bcs .90
jsr CORE.ShiftArgVToken Skip |
bra .72 and exec
@ -323,19 +311,19 @@ CORE.GetArgX >LDYA ZPArgVBuf
.9 sec
rts
*--------------------------------------
CORE.StkPushPtr lda ZPFileBufPtrBak
CORE.StkPushPtr lda ZPInputLinePtr
jsr CORE.StkPush
bcs CORE.StkPullPtr.9
lda ZPFileBufPtrBak+1
lda ZPInputLinePtr+1
bra CORE.StkPush
.9 rts
*--------------------------------------
CORE.StkPullPtr jsr CORE.StkPull
bcs CORE.StkPullPtr.9
sta ZPFileBufPtr+1
sta ZPInputBufPtr+1
jsr CORE.StkPull
bcs CORE.StkPullPtr.9
sta ZPFileBufPtr
sta ZPInputBufPtr
CORE.StkPullPtr.9
rts
*--------------------------------------
@ -347,10 +335,10 @@ CORE.StkGetPtr lda (pData) StackPtr
tay
lda (pData),y
sta ZPFileBufPtr
sta ZPInputBufPtr
iny
lda (pData),y
sta ZPFileBufPtr+1
sta ZPInputBufPtr+1
clc
rts

View File

@ -111,9 +111,9 @@ IO.PrintBatchErrMsg
bne .2 Scan until EoL
ldx ZPPtr1
cpx ZPFileBufPtr
cpx ZPInputBufPtr
lda ZPPtr1+1
sbc ZPFileBufPtr+1
sbc ZPInputBufPtr+1
bcc .1 not this line....
.4 ldy #0
@ -137,7 +137,7 @@ IO.PrintBatchErrMsg
lda (pPS),y
>SYSCALL fprintf
lda ZPFileBufPtr
lda ZPInputBufPtr
sec
sbc ZPPtr2
beq .8

View File

@ -62,8 +62,9 @@ ZPPtr1 .BS 2
ZPPtr2 .BS 2
ZPPtr3 .BS 2
ZPCLBuf .BS 2
ZPFileBufPtr .BS 2
ZPFileBufPtrBak .BS 2
ZPFileBuf .BS 2
ZPInputBufPtr .BS 2
ZPInputLinePtr .BS 2
ZPArgVBuf .BS 2
ZPArgVBufPtr .BS 2
ZS.END .ED
@ -185,7 +186,8 @@ CS.RUN jsr CL.Init
txa
>STA.G hFileBuf
>SYSCALL GetMemPtr
>STYA ZPFileBufPtr
>STYA ZPFileBuf
>STYA ZPInputBufPtr
lda #0
jsr CMD.SHIFTA Remove $0=/bin/shell
@ -300,12 +302,17 @@ CS.RUN.INTERACTIVE
jsr HIS.Add
jsr CORE.GetCmdFromClBuf
>LDYA ZPCLBuf
>STYA ZPInputBufPtr
.7 jsr CORE.GetCmd
bcs .8
lda (ZPArgVBuf)
beq .8
jsr CORE.Exec
bcc .7
.8 jmp CS.RUN.LOOP.END
*--------------------------------------
@ -363,22 +370,15 @@ CS.RUN.BATCH >SYSCALL GetChar
clc
jmp CS.RUN.LOOP.END
.2 jsr CORE.GetCmdFromFileBuf
.2 jsr CORE.GetCmd
bcc .7
cmp #C.EOF
bne .3
lda #$ff
>STA.G bExit
inc
clc
bra CS.RUN.LOOP.END
.3 sec
bra CS.RUN.LOOP.END
.7 lda (ZPArgVBuf)
beq CS.RUN.LOOP.80
@ -398,7 +398,8 @@ CS.RUN.LOOP.END ldy #S.PS.RC
sta (pPs),y
bcc CS.RUN.LOOP.8
tay
beq CS.RUN.LOOP.8
>LDA.G hFileBuf batch mode ?
beq .1
@ -663,6 +664,8 @@ bECHO.N .BS 1
bREAD.S .BS 1
Sleep .BS 4
StatBuf .BS S.STAT
TimeBuf .BS S.TIME
CL.hCLBuf .BS 1
CL.Ptr .BS 1
@ -677,10 +680,7 @@ CORE.ArgIndex .BS 1
CORE.Varname .BS 1
CORE.Test .BS 1
CORE.Operator .BS 1
CORE.PSFlags .BS 1
StatBuf .BS S.STAT
TimeBuf .BS S.TIME
HIS.hBuf .BS 1
HIS.Count .BS 1