mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-14 00:31:41 +00:00
Kernel 0.92+
This commit is contained in:
parent
8e1da7eb9a
commit
9fb1e9b49d
Binary file not shown.
@ -334,10 +334,10 @@ CMD.TIME clc
|
|||||||
bra .2
|
bra .2
|
||||||
.1 >PUSHW L.FMT.TIME
|
.1 >PUSHW L.FMT.TIME
|
||||||
|
|
||||||
.2 >LDYA ZPCLBuf
|
.2 >LEA.G StatBuf
|
||||||
>SYSCALL StrFTime
|
>SYSCALL StrFTime
|
||||||
|
|
||||||
>LDYA ZPCLBuf
|
>LEA.G StatBuf
|
||||||
>SYSCALL puts
|
>SYSCALL puts
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -17,32 +17,19 @@ CORE.Quit >LDA.G CORE.hArgVBuf
|
|||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Input : ZPCLBuf/ZPFileBufPtr
|
* Input : ZPCLBuf/ZPFileBuf
|
||||||
* Get Line from buf until ;, CR, \0 (EOL / EOF) -> ZPArgVBuf
|
* Get Line from buf until ;, CR, \0 (EOL / EOF) -> ZPArgVBuf
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.GetCmdFromFileBuf
|
CORE.GetCmd >LDYA ZPInputBufPtr
|
||||||
>LDYA ZPFileBufPtr
|
>STYA ZPInputLinePtr
|
||||||
>STYA ZPFileBufPtrBak
|
|
||||||
|
|
||||||
jsr CORE.GetCmd
|
|
||||||
bcs .9
|
|
||||||
|
|
||||||
>LDYA ZPPtr1
|
lda (ZPInputBufPtr)
|
||||||
>STYA ZPFileBufPtr
|
|
||||||
.9 rts
|
|
||||||
|
|
||||||
CORE.GetCmdFromClBuf
|
|
||||||
>LDYA ZPCLBuf
|
|
||||||
|
|
||||||
CORE.GetCmd >STYA ZPPtr1
|
|
||||||
lda (ZPPtr1)
|
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
ldx #0 not in "
|
ldx #0 reset "" flag
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
|
|
||||||
.1 lda (ZPPtr1),y
|
.1 lda (ZPInputBufPtr),y
|
||||||
beq .7
|
beq .7
|
||||||
|
|
||||||
cmp #C.CR
|
cmp #C.CR
|
||||||
@ -52,7 +39,7 @@ CORE.GetCmd >STYA ZPPtr1
|
|||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
txa
|
txa
|
||||||
eor #$80 toggle " switch
|
eor #$80 toggle "" flag
|
||||||
tax
|
tax
|
||||||
|
|
||||||
lda #'"'
|
lda #'"'
|
||||||
@ -62,7 +49,7 @@ CORE.GetCmd >STYA ZPPtr1
|
|||||||
bne .5
|
bne .5
|
||||||
|
|
||||||
txa
|
txa
|
||||||
beq .6
|
beq .6 not between ""
|
||||||
|
|
||||||
lda #';'
|
lda #';'
|
||||||
|
|
||||||
@ -80,10 +67,10 @@ CORE.GetCmd >STYA ZPPtr1
|
|||||||
.7 clc
|
.7 clc
|
||||||
|
|
||||||
tya
|
tya
|
||||||
adc ZPPtr1
|
adc ZPInputBufPtr
|
||||||
sta ZPPtr1
|
sta ZPInputBufPtr
|
||||||
bcc .8
|
bcc .8
|
||||||
inc ZPPtr1+1
|
inc ZPInputBufPtr+1
|
||||||
|
|
||||||
.8 lda #0
|
.8 lda #0
|
||||||
sta (ZPArgVBuf),y
|
sta (ZPArgVBuf),y
|
||||||
@ -91,8 +78,7 @@ CORE.GetCmd >STYA ZPPtr1
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 lda #C.EOF
|
.9 sec A=0
|
||||||
sec
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Input : ZPArgVBuf (String)
|
* Input : ZPArgVBuf (String)
|
||||||
@ -123,14 +109,14 @@ CORE.Exec >PUSHW ZPArgVBuf
|
|||||||
|
|
||||||
>SYSCALL Args2ArgV TOKENIZE CL in ZPArgVBuf
|
>SYSCALL Args2ArgV TOKENIZE CL in ZPArgVBuf
|
||||||
|
|
||||||
|
>STZ.G CL.CmdSep
|
||||||
|
|
||||||
lda (ZPArgVBufPtr) empty line ?
|
lda (ZPArgVBufPtr) empty line ?
|
||||||
beq .80
|
beq .80
|
||||||
|
|
||||||
cmp #'#' comment ?
|
cmp #'#' comment ?
|
||||||
beq .80
|
beq .80
|
||||||
|
|
||||||
>STZ.G CL.CmdSep
|
|
||||||
|
|
||||||
*************** LOOP Cmd Arg
|
*************** LOOP Cmd Arg
|
||||||
|
|
||||||
.10 lda #S.PS.F.HOLD+S.PS.F.DUPENV
|
.10 lda #S.PS.F.HOLD+S.PS.F.DUPENV
|
||||||
@ -140,8 +126,9 @@ CORE.Exec >PUSHW ZPArgVBuf
|
|||||||
cmp #'|'
|
cmp #'|'
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
* PIPE
|
jsr IO.Pipe.In
|
||||||
|
bcs .90
|
||||||
|
|
||||||
*************** LOOP Token
|
*************** LOOP Token
|
||||||
|
|
||||||
.1 cmp #'#' comment ?
|
.1 cmp #'#' comment ?
|
||||||
@ -182,7 +169,8 @@ CORE.Exec >PUSHW ZPArgVBuf
|
|||||||
|
|
||||||
>STA.G CL.CmdSep
|
>STA.G CL.CmdSep
|
||||||
|
|
||||||
* PIPE
|
jsr IO.Pipe.Out
|
||||||
|
bcs .90
|
||||||
|
|
||||||
jsr CORE.ShiftArgVToken Skip |
|
jsr CORE.ShiftArgVToken Skip |
|
||||||
bra .72 and exec
|
bra .72 and exec
|
||||||
@ -323,19 +311,19 @@ CORE.GetArgX >LDYA ZPArgVBuf
|
|||||||
.9 sec
|
.9 sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.StkPushPtr lda ZPFileBufPtrBak
|
CORE.StkPushPtr lda ZPInputLinePtr
|
||||||
jsr CORE.StkPush
|
jsr CORE.StkPush
|
||||||
bcs CORE.StkPullPtr.9
|
bcs CORE.StkPullPtr.9
|
||||||
lda ZPFileBufPtrBak+1
|
lda ZPInputLinePtr+1
|
||||||
bra CORE.StkPush
|
bra CORE.StkPush
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.StkPullPtr jsr CORE.StkPull
|
CORE.StkPullPtr jsr CORE.StkPull
|
||||||
bcs CORE.StkPullPtr.9
|
bcs CORE.StkPullPtr.9
|
||||||
sta ZPFileBufPtr+1
|
sta ZPInputBufPtr+1
|
||||||
jsr CORE.StkPull
|
jsr CORE.StkPull
|
||||||
bcs CORE.StkPullPtr.9
|
bcs CORE.StkPullPtr.9
|
||||||
sta ZPFileBufPtr
|
sta ZPInputBufPtr
|
||||||
CORE.StkPullPtr.9
|
CORE.StkPullPtr.9
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -347,10 +335,10 @@ CORE.StkGetPtr lda (pData) StackPtr
|
|||||||
tay
|
tay
|
||||||
|
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
sta ZPFileBufPtr
|
sta ZPInputBufPtr
|
||||||
iny
|
iny
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
sta ZPFileBufPtr+1
|
sta ZPInputBufPtr+1
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
@ -111,9 +111,9 @@ IO.PrintBatchErrMsg
|
|||||||
bne .2 Scan until EoL
|
bne .2 Scan until EoL
|
||||||
|
|
||||||
ldx ZPPtr1
|
ldx ZPPtr1
|
||||||
cpx ZPFileBufPtr
|
cpx ZPInputBufPtr
|
||||||
lda ZPPtr1+1
|
lda ZPPtr1+1
|
||||||
sbc ZPFileBufPtr+1
|
sbc ZPInputBufPtr+1
|
||||||
bcc .1 not this line....
|
bcc .1 not this line....
|
||||||
|
|
||||||
.4 ldy #0
|
.4 ldy #0
|
||||||
@ -137,7 +137,7 @@ IO.PrintBatchErrMsg
|
|||||||
lda (pPS),y
|
lda (pPS),y
|
||||||
>SYSCALL fprintf
|
>SYSCALL fprintf
|
||||||
|
|
||||||
lda ZPFileBufPtr
|
lda ZPInputBufPtr
|
||||||
sec
|
sec
|
||||||
sbc ZPPtr2
|
sbc ZPPtr2
|
||||||
beq .8
|
beq .8
|
||||||
|
@ -62,8 +62,9 @@ ZPPtr1 .BS 2
|
|||||||
ZPPtr2 .BS 2
|
ZPPtr2 .BS 2
|
||||||
ZPPtr3 .BS 2
|
ZPPtr3 .BS 2
|
||||||
ZPCLBuf .BS 2
|
ZPCLBuf .BS 2
|
||||||
ZPFileBufPtr .BS 2
|
ZPFileBuf .BS 2
|
||||||
ZPFileBufPtrBak .BS 2
|
ZPInputBufPtr .BS 2
|
||||||
|
ZPInputLinePtr .BS 2
|
||||||
ZPArgVBuf .BS 2
|
ZPArgVBuf .BS 2
|
||||||
ZPArgVBufPtr .BS 2
|
ZPArgVBufPtr .BS 2
|
||||||
ZS.END .ED
|
ZS.END .ED
|
||||||
@ -185,7 +186,8 @@ CS.RUN jsr CL.Init
|
|||||||
txa
|
txa
|
||||||
>STA.G hFileBuf
|
>STA.G hFileBuf
|
||||||
>SYSCALL GetMemPtr
|
>SYSCALL GetMemPtr
|
||||||
>STYA ZPFileBufPtr
|
>STYA ZPFileBuf
|
||||||
|
>STYA ZPInputBufPtr
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
jsr CMD.SHIFTA Remove $0=/bin/shell
|
jsr CMD.SHIFTA Remove $0=/bin/shell
|
||||||
@ -300,12 +302,17 @@ CS.RUN.INTERACTIVE
|
|||||||
|
|
||||||
jsr HIS.Add
|
jsr HIS.Add
|
||||||
|
|
||||||
jsr CORE.GetCmdFromClBuf
|
>LDYA ZPCLBuf
|
||||||
|
>STYA ZPInputBufPtr
|
||||||
|
|
||||||
|
.7 jsr CORE.GetCmd
|
||||||
|
bcs .8
|
||||||
|
|
||||||
lda (ZPArgVBuf)
|
lda (ZPArgVBuf)
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
jsr CORE.Exec
|
jsr CORE.Exec
|
||||||
|
bcc .7
|
||||||
|
|
||||||
.8 jmp CS.RUN.LOOP.END
|
.8 jmp CS.RUN.LOOP.END
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -363,21 +370,14 @@ CS.RUN.BATCH >SYSCALL GetChar
|
|||||||
clc
|
clc
|
||||||
jmp CS.RUN.LOOP.END
|
jmp CS.RUN.LOOP.END
|
||||||
|
|
||||||
.2 jsr CORE.GetCmdFromFileBuf
|
.2 jsr CORE.GetCmd
|
||||||
|
|
||||||
bcc .7
|
bcc .7
|
||||||
|
|
||||||
cmp #C.EOF
|
|
||||||
bne .3
|
|
||||||
|
|
||||||
lda #$ff
|
lda #$ff
|
||||||
>STA.G bExit
|
>STA.G bExit
|
||||||
inc
|
inc
|
||||||
clc
|
clc
|
||||||
bra CS.RUN.LOOP.END
|
bra CS.RUN.LOOP.END
|
||||||
|
|
||||||
.3 sec
|
|
||||||
bra CS.RUN.LOOP.END
|
|
||||||
|
|
||||||
.7 lda (ZPArgVBuf)
|
.7 lda (ZPArgVBuf)
|
||||||
beq CS.RUN.LOOP.80
|
beq CS.RUN.LOOP.80
|
||||||
@ -398,7 +398,8 @@ CS.RUN.LOOP.END ldy #S.PS.RC
|
|||||||
sta (pPs),y
|
sta (pPs),y
|
||||||
|
|
||||||
bcc CS.RUN.LOOP.8
|
bcc CS.RUN.LOOP.8
|
||||||
|
tay
|
||||||
|
beq CS.RUN.LOOP.8
|
||||||
>LDA.G hFileBuf batch mode ?
|
>LDA.G hFileBuf batch mode ?
|
||||||
beq .1
|
beq .1
|
||||||
|
|
||||||
@ -663,6 +664,8 @@ bECHO.N .BS 1
|
|||||||
bREAD.S .BS 1
|
bREAD.S .BS 1
|
||||||
|
|
||||||
Sleep .BS 4
|
Sleep .BS 4
|
||||||
|
StatBuf .BS S.STAT
|
||||||
|
TimeBuf .BS S.TIME
|
||||||
|
|
||||||
CL.hCLBuf .BS 1
|
CL.hCLBuf .BS 1
|
||||||
CL.Ptr .BS 1
|
CL.Ptr .BS 1
|
||||||
@ -677,10 +680,7 @@ CORE.ArgIndex .BS 1
|
|||||||
CORE.Varname .BS 1
|
CORE.Varname .BS 1
|
||||||
CORE.Test .BS 1
|
CORE.Test .BS 1
|
||||||
CORE.Operator .BS 1
|
CORE.Operator .BS 1
|
||||||
|
|
||||||
CORE.PSFlags .BS 1
|
CORE.PSFlags .BS 1
|
||||||
StatBuf .BS S.STAT
|
|
||||||
TimeBuf .BS S.TIME
|
|
||||||
|
|
||||||
HIS.hBuf .BS 1
|
HIS.hBuf .BS 1
|
||||||
HIS.Count .BS 1
|
HIS.Count .BS 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user