mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-16 18:30:26 +00:00
Kernel 0.92+
This commit is contained in:
parent
4f34d9e7c1
commit
086ceb7f8f
Binary file not shown.
@ -4,6 +4,7 @@ AUTO 4,1
|
|||||||
.LIST OFF
|
.LIST OFF
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CSH.OPChars .AS "!~+-*/%=&|^&<>"
|
CSH.OPChars .AS "!~+-*/%=&|^&<>"
|
||||||
|
CSH.OPChars.Cnt .EQ *-CSH.OPChars
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Pre Operators: + - ! ~ ++ --
|
* Pre Operators: + - ! ~ ++ --
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -371,12 +371,12 @@ CSH.FnEval jsr CSH.GetCharNB
|
|||||||
bne .99
|
bne .99
|
||||||
|
|
||||||
inc ZPPtr1 advance to next arg
|
inc ZPPtr1 advance to next arg
|
||||||
beq .7
|
bne .4
|
||||||
inc ZPPtr1+1
|
inc ZPPtr1+1
|
||||||
lda (ZPPtr1)
|
.4 lda (ZPPtr1) no more arg in fn definition
|
||||||
beq .7
|
beq .7
|
||||||
|
|
||||||
.4 jsr CSH.GetNextCharNB
|
jsr CSH.GetNextCharNB
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
cmp #','
|
cmp #','
|
||||||
@ -388,10 +388,11 @@ CSH.FnEval jsr CSH.GetCharNB
|
|||||||
bcs .9
|
bcs .9
|
||||||
cmp #')'
|
cmp #')'
|
||||||
bne .9
|
bne .9
|
||||||
|
jsr CSH.GetNextCharNB Skip )
|
||||||
|
|
||||||
|
|
||||||
* TO DO : Execute
|
* TO DO : Execute
|
||||||
|
|
||||||
jsr CSH.GetNextCharNB Skip )
|
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
@ -1028,7 +1029,7 @@ CSH.GetChar lda (ZPFileBufPtr)
|
|||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
CSH.IsOPChar ldx #13
|
CSH.IsOPChar ldx #CSH.OPChars.Cnt-1
|
||||||
|
|
||||||
.1 cmp CSH.OPChars,x
|
.1 cmp CSH.OPChars,x
|
||||||
beq .8
|
beq .8
|
||||||
|
@ -200,7 +200,7 @@ CORE.ExecCmd ldy #$ff
|
|||||||
bra .12
|
bra .12
|
||||||
|
|
||||||
.11 >PUSHW ZPArgVBuf
|
.11 >PUSHW ZPArgVBuf
|
||||||
>LDYA L.CORE.INT
|
>LDYA L.CORE.CMD
|
||||||
jsr Lookup no / found, search internal...
|
jsr Lookup no / found, search internal...
|
||||||
bcc .13 not internal
|
bcc .13 not internal
|
||||||
|
|
||||||
@ -228,11 +228,53 @@ CORE.ExecCmd ldy #$ff
|
|||||||
bmi CORE.ExecExtCmd
|
bmi CORE.ExecExtCmd
|
||||||
|
|
||||||
tax
|
tax
|
||||||
jmp (J.CMD,x)
|
jmp (J.CORE.CMD,x)
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
CORE.Run >LDYA ZPInputBufPtr Save Actual cmd for looping
|
||||||
|
>STYA ZPInputCmdPtr
|
||||||
|
|
||||||
|
jsr CORE.GetCharNB
|
||||||
|
bcs CORE.Run.RTS Ending 0, CS,A=0
|
||||||
|
|
||||||
|
cmp #'#' commented line?
|
||||||
|
bne .2
|
||||||
|
|
||||||
|
.1 jsr CORE.GetNextCharNB
|
||||||
|
bcs CORE.Run.RTS A=0, CS
|
||||||
|
eor #C.CR
|
||||||
|
bne .1
|
||||||
|
rts EOL, CC,A=0
|
||||||
|
|
||||||
|
.2 cmp #'.'
|
||||||
|
bne .3
|
||||||
|
|
||||||
|
ldy #1
|
||||||
|
lda (ZPInputBufPtr),y
|
||||||
|
cmp #C.SPACE
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
>LDA.G CORE.PSFlags yes, child process will run in same ENV
|
||||||
|
and #$ff^S.PS.F.DUPENV
|
||||||
|
sta (pData),y
|
||||||
|
|
||||||
|
jsr CORE.GetNextCharNB skip ". "
|
||||||
|
bcs CORE.Run.RTS nothing to execute...
|
||||||
|
|
||||||
|
.3 >LDYA L.CORE.CMD internal command ?
|
||||||
|
jsr CORE.Lookup
|
||||||
|
bcs .4
|
||||||
|
|
||||||
|
jmp (J.CORE.CMD,x)
|
||||||
|
|
||||||
|
.4
|
||||||
|
|
||||||
|
|
||||||
|
.8 clc
|
||||||
|
CORE.Run.RTS rts
|
||||||
|
*--------------------------------------
|
||||||
CORE.ExecExtCmd >PUSHB.G CORE.PSFlags
|
CORE.ExecExtCmd >PUSHB.G CORE.PSFlags
|
||||||
>LDYA ZPArgVBuf
|
>LDYA ZPArgVBuf
|
||||||
>SYSCALL execv
|
>SYSCALL execv
|
||||||
@ -305,6 +347,116 @@ CORE.GetArgX >LDYA ZPArgVBuf
|
|||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
.9 sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
* search ZPInputBufPtr in Y,A table
|
||||||
|
*
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.Lookup >STYA ZPPtr1
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
|
||||||
|
.1 phx
|
||||||
|
|
||||||
|
ldy #$ff
|
||||||
|
|
||||||
|
.2 iny
|
||||||
|
lda (ZPInputBufPtr),y
|
||||||
|
beq .3 Src Keyword end
|
||||||
|
|
||||||
|
jsr CORE.IsSep
|
||||||
|
bcc .3 Src Keyword end
|
||||||
|
|
||||||
|
lda (ZPPtr1),y
|
||||||
|
beq .4 Table Keyword end
|
||||||
|
cmp (ZPInputBufPtr),y
|
||||||
|
beq .2
|
||||||
|
|
||||||
|
bra .4
|
||||||
|
|
||||||
|
.3 lda (ZPPtr1),y
|
||||||
|
bne .4
|
||||||
|
plx
|
||||||
|
|
||||||
|
tya
|
||||||
|
sec
|
||||||
|
adc ZPInputBufPtr
|
||||||
|
sta ZPInputBufPtr
|
||||||
|
bcc .8
|
||||||
|
|
||||||
|
clc
|
||||||
|
inc ZPInputBufPtr+1
|
||||||
|
|
||||||
|
.8 rts
|
||||||
|
|
||||||
|
.4 inc ZPPtr1
|
||||||
|
bne .5
|
||||||
|
inc ZPPtr1+1
|
||||||
|
|
||||||
|
.5 lda (ZPPtr1)
|
||||||
|
bne .4
|
||||||
|
|
||||||
|
inc ZPPtr1
|
||||||
|
bne .6
|
||||||
|
inc ZPPtr1+1
|
||||||
|
|
||||||
|
.6 plx
|
||||||
|
inx
|
||||||
|
inx
|
||||||
|
|
||||||
|
lda (ZPPtr1) Array Ending 0, must be an external Cmd....
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
lda #E.CSYN
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.IsSep cmp #C.SPACE
|
||||||
|
beq .8
|
||||||
|
cmp #';'
|
||||||
|
beq .8
|
||||||
|
cmp #'|'
|
||||||
|
beq .8
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
.8 clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.GetCharNB jsr CORE.GetChar
|
||||||
|
bcs CORE.GetNextCharNB.RTS
|
||||||
|
jsr CORE.CheckCharNB
|
||||||
|
bcc CORE.GetNextCharNB.RTS
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.GetNextCharNB
|
||||||
|
jsr CORE.GetNextChar
|
||||||
|
bcs CORE.GetNextCharNB.RTS
|
||||||
|
jsr CORE.CheckCharNB
|
||||||
|
bcs CORE.GetNextCharNB
|
||||||
|
CORE.GetNextCharNB.RTS
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.CheckCharNB
|
||||||
|
cmp #C.SPACE
|
||||||
|
beq .9
|
||||||
|
cmp #C.LF
|
||||||
|
beq .9
|
||||||
|
cmp #C.TAB
|
||||||
|
beq .9
|
||||||
|
clc
|
||||||
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.GetNextChar
|
||||||
|
inc ZPInputBufPtr
|
||||||
|
bne CORE.GetChar
|
||||||
|
inc ZPInputBufPtr+1
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.GetChar lda (ZPInputBufPtr)
|
||||||
|
beq .9
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
.9 sec
|
.9 sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -4,7 +4,7 @@ AUTO 4,1
|
|||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
.TF BIN/SHELL
|
.TF BIN/SH
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
History.MAX .EQ 256
|
History.MAX .EQ 256
|
||||||
CORE.STACK.MAX .EQ 64
|
CORE.STACK.MAX .EQ 64
|
||||||
@ -110,17 +110,8 @@ J.ESC .DA CL.BS left arrow
|
|||||||
.DA HIS.GetNext
|
.DA HIS.GetNext
|
||||||
.DA HIS.GetPrev
|
.DA HIS.GetPrev
|
||||||
.DA CL.NAK right arow
|
.DA CL.NAK right arow
|
||||||
L.CORE.IO .DA CORE.IO
|
L.CORE.CMD .DA CORE.CMD
|
||||||
J.CORE.IO .DA CORE.IO.AMP
|
J.CORE.CMD .DA CMD.NOHUP
|
||||||
.DA CORE.IO.IN
|
|
||||||
.DA CORE.IO.OUTA
|
|
||||||
.DA CORE.IO.OUT
|
|
||||||
.DA CORE.IO.1OUTA
|
|
||||||
.DA CORE.IO.1OUT
|
|
||||||
.DA CORE.IO.2OUTA
|
|
||||||
.DA CORE.IO.2OUT
|
|
||||||
L.CORE.INT .DA CORE.INT
|
|
||||||
J.CMD .DA CMD.NOHUP
|
|
||||||
.DA CMD.CD
|
.DA CMD.CD
|
||||||
.DA CMD.DATE
|
.DA CMD.DATE
|
||||||
.DA CMD.ECHO
|
.DA CMD.ECHO
|
||||||
@ -147,6 +138,15 @@ J.CMD .DA CMD.NOHUP
|
|||||||
.DA CMD.IF
|
.DA CMD.IF
|
||||||
.DA CMD.ELSE
|
.DA CMD.ELSE
|
||||||
.DA CMD.FI
|
.DA CMD.FI
|
||||||
|
L.CORE.IO .DA CORE.IO
|
||||||
|
J.CORE.IO .DA CORE.IO.AMP
|
||||||
|
.DA CORE.IO.IN
|
||||||
|
.DA CORE.IO.OUTA
|
||||||
|
.DA CORE.IO.OUT
|
||||||
|
.DA CORE.IO.1OUTA
|
||||||
|
.DA CORE.IO.1OUT
|
||||||
|
.DA CORE.IO.2OUTA
|
||||||
|
.DA CORE.IO.2OUT
|
||||||
L.EXP.BEGIN .DA EXP.BEGIN
|
L.EXP.BEGIN .DA EXP.BEGIN
|
||||||
L.EXP.OP.UNARY .DA EXP.OP.UNARY
|
L.EXP.OP.UNARY .DA EXP.OP.UNARY
|
||||||
J.EXP.OP.UNARY .DA EXP.OP.UNARY.D
|
J.EXP.OP.UNARY .DA EXP.OP.UNARY.D
|
||||||
@ -313,14 +313,7 @@ CS.RUN.INTERACTIVE
|
|||||||
txa
|
txa
|
||||||
>STA.G hInputBuf
|
>STA.G hInputBuf
|
||||||
|
|
||||||
.7 jsr CORE.GetCmd
|
.7 jsr CORE.Run
|
||||||
bcs .8
|
|
||||||
|
|
||||||
lda (ZPArgVBuf)
|
|
||||||
beq .8
|
|
||||||
|
|
||||||
jsr CORE.Exec
|
|
||||||
bcc .7
|
|
||||||
|
|
||||||
.8 jmp CS.RUN.LOOP.END
|
.8 jmp CS.RUN.LOOP.END
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -380,7 +373,7 @@ CS.RUN.BATCH >SYSCALL GetChar
|
|||||||
clc
|
clc
|
||||||
jmp CS.RUN.LOOP.END
|
jmp CS.RUN.LOOP.END
|
||||||
|
|
||||||
.2 jsr CORE.GetCmd
|
.2 jsr CORE.Run
|
||||||
bcc .7
|
bcc .7
|
||||||
|
|
||||||
lda #$ff
|
lda #$ff
|
||||||
@ -389,20 +382,15 @@ CS.RUN.BATCH >SYSCALL GetChar
|
|||||||
clc
|
clc
|
||||||
bra CS.RUN.LOOP.END
|
bra CS.RUN.LOOP.END
|
||||||
|
|
||||||
.7 lda (ZPArgVBuf)
|
.7 >LDA.G bSET.X
|
||||||
beq CS.RUN.LOOP.80
|
* beq .8
|
||||||
|
|
||||||
>LDA.G bSET.X
|
* >PUSHW ZPArgVBuf
|
||||||
beq .8
|
* >PUSHBI 2
|
||||||
|
* >LDYA L.MSG.TRACE
|
||||||
|
* >SYSCALL printf
|
||||||
|
|
||||||
>PUSHW ZPArgVBuf
|
* bcs .9
|
||||||
>PUSHBI 2
|
|
||||||
>LDYA L.MSG.TRACE
|
|
||||||
>SYSCALL printf
|
|
||||||
|
|
||||||
bcs .9
|
|
||||||
|
|
||||||
.8 jsr CORE.Exec
|
|
||||||
|
|
||||||
CS.RUN.LOOP.END ldy #S.PS.RC
|
CS.RUN.LOOP.END ldy #S.PS.RC
|
||||||
sta (pPs),y
|
sta (pPs),y
|
||||||
@ -576,19 +564,7 @@ ENV.PS1 .AZ "PS1"
|
|||||||
ENV.HOME .AZ "HOME"
|
ENV.HOME .AZ "HOME"
|
||||||
HOME.PROFILE .AZ "${HOME}PROFILE"
|
HOME.PROFILE .AZ "${HOME}PROFILE"
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* https://www.tldp.org/LDP/abs/html/io-redirection.html
|
CORE.CMD .AZ "NOHUP"
|
||||||
*--------------------------------------
|
|
||||||
CORE.IO .AZ "&"
|
|
||||||
.AZ "<"
|
|
||||||
.AZ ">>"
|
|
||||||
.AZ ">"
|
|
||||||
.AZ "1>>"
|
|
||||||
.AZ "1>"
|
|
||||||
.AZ "2>>"
|
|
||||||
.AZ "2>"
|
|
||||||
.HS 00
|
|
||||||
*--------------------------------------
|
|
||||||
CORE.INT .AZ "NOHUP"
|
|
||||||
.AZ "CD"
|
.AZ "CD"
|
||||||
.AZ "DATE"
|
.AZ "DATE"
|
||||||
.AZ "ECHO"
|
.AZ "ECHO"
|
||||||
@ -617,6 +593,18 @@ CORE.INT .AZ "NOHUP"
|
|||||||
.AZ "FI"
|
.AZ "FI"
|
||||||
.HS 00
|
.HS 00
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
* https://www.tldp.org/LDP/abs/html/io-redirection.html
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.IO .AZ "&"
|
||||||
|
.AZ "<"
|
||||||
|
.AZ ">>"
|
||||||
|
.AZ ">"
|
||||||
|
.AZ "1>>"
|
||||||
|
.AZ "1>"
|
||||||
|
.AZ "2>>"
|
||||||
|
.AZ "2>"
|
||||||
|
.HS 00
|
||||||
|
*--------------------------------------
|
||||||
EXP.BEGIN .AZ "!["
|
EXP.BEGIN .AZ "!["
|
||||||
.AZ "["
|
.AZ "["
|
||||||
.HS 00
|
.HS 00
|
||||||
|
@ -14,10 +14,11 @@ AUTO 4,1
|
|||||||
* ## RETURN VALUE
|
* ## RETURN VALUE
|
||||||
* On stack (float)
|
* On stack (float)
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.strtof jsr K.AToF.I
|
K.strtof >STYA TXTPTR Ptr to source string
|
||||||
|
|
||||||
>PULLW ZPPtr1
|
>PULLW ZPPtr1
|
||||||
|
|
||||||
|
jsr K.AToF.I
|
||||||
|
|
||||||
lda TXTPTR
|
lda TXTPTR
|
||||||
sta (ZPPtr1)
|
sta (ZPPtr1)
|
||||||
ldy #1
|
ldy #1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user