mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-19 20:29:34 +00:00
Kernel 0.93++
This commit is contained in:
parent
e04861ce3a
commit
0c494b0094
Binary file not shown.
|
@ -23,7 +23,7 @@ CMD.NOHUP lda (ZPArgVBufPtr)
|
||||||
|
|
||||||
lda #S.PS.F.NOHUP
|
lda #S.PS.F.NOHUP
|
||||||
tsb CORE.PSFlags
|
tsb CORE.PSFlags
|
||||||
>LDYA ZPArgVBuf
|
|
||||||
jmp CORE.ExecExtCmd
|
jmp CORE.ExecExtCmd
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CMD.SHIFT lda (ZPArgVBufPtr)
|
CMD.SHIFT lda (ZPArgVBufPtr)
|
||||||
|
@ -188,35 +188,27 @@ CMD.SET.1
|
||||||
.1 jsr CMD.IsSwitch
|
.1 jsr CMD.IsSwitch
|
||||||
bcs .6
|
bcs .6
|
||||||
|
|
||||||
cmp #'C'
|
ldx #SET.VARS-SET.FLAGS
|
||||||
|
|
||||||
|
.2 dex
|
||||||
|
bmi .4
|
||||||
|
cmp SET.FLAGS,x
|
||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
ldy #bSET.C
|
ldy SET.VARS,x
|
||||||
bra .5
|
|
||||||
|
lda (pData),y
|
||||||
|
eor #$ff
|
||||||
|
sta (pData),y
|
||||||
|
|
||||||
.2 cmp #'X'
|
|
||||||
bne .3
|
|
||||||
|
|
||||||
ldy #bSET.X
|
|
||||||
bra .5
|
|
||||||
|
|
||||||
.3 cmp #'E'
|
|
||||||
bne .4
|
|
||||||
|
|
||||||
ldy #bSET.E
|
|
||||||
bra .5
|
bra .5
|
||||||
|
|
||||||
.4 cmp #'F'
|
.4 cmp #'F'
|
||||||
bne .99
|
bne .99
|
||||||
|
|
||||||
jsr CORE.FUNCRESET
|
jsr CORE.FUNCRESET
|
||||||
bra .50
|
|
||||||
|
|
||||||
.5 lda (pData),y
|
.5 jsr CORE.ArgV.Next
|
||||||
eor #$ff
|
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
.50 jsr CORE.ArgV.Next
|
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
clc
|
clc
|
||||||
|
@ -1195,11 +1187,14 @@ CMD.FI jsr CORE.StkPull
|
||||||
CMD.IsSwitch lda (ZPArgVBufPtr)
|
CMD.IsSwitch lda (ZPArgVBufPtr)
|
||||||
cmp #'-'
|
cmp #'-'
|
||||||
bne .9
|
bne .9
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
lda (ZPArgVBufPtr),y
|
lda (ZPArgVBufPtr),y
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
cmp #'0' is -0 ... -9 ?
|
cmp #'0' is -0 ... -9 ?
|
||||||
bcc .9
|
bcc .9
|
||||||
|
|
||||||
cmp #'9'+1
|
cmp #'9'+1
|
||||||
bcc .9
|
bcc .9
|
||||||
|
|
||||||
|
@ -1207,11 +1202,11 @@ CMD.IsSwitch lda (ZPArgVBufPtr)
|
||||||
iny
|
iny
|
||||||
lda (ZPArgVBufPtr),y
|
lda (ZPArgVBufPtr),y
|
||||||
bne .9
|
bne .9
|
||||||
|
|
||||||
txa
|
txa
|
||||||
jmp ToUpperCase
|
jmp ToUpperCase
|
||||||
|
|
||||||
.9 sec
|
.9 sec
|
||||||
CMD.IsSwitch.RTS
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CMD.PrintArgVBufPtr
|
CMD.PrintArgVBufPtr
|
||||||
|
|
|
@ -2,14 +2,7 @@ NEW
|
||||||
AUTO 3,1
|
AUTO 3,1
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.Init >LDYAI 256
|
CORE.Init lda #PUSHD.STACK
|
||||||
>SYSCALL GetMem
|
|
||||||
bcs .9
|
|
||||||
>STYA ZPArgVBuf
|
|
||||||
txa
|
|
||||||
>STA.G CORE.hArgVBuf
|
|
||||||
|
|
||||||
lda #PUSHD.STACK
|
|
||||||
>STA.G PUSHD.STACK
|
>STA.G PUSHD.STACK
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
|
@ -67,7 +60,8 @@ CORE.Load.YAX stx M32.ACC X = Code to Execute
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* http://heirloom.sourceforge.net/sh/sh.1.html
|
* http://heirloom.sourceforge.net/sh/sh.1.html
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Input : ZPArgVBuf (String)
|
* CORE.Run
|
||||||
|
* Input : ZPInputBufPtr (String)
|
||||||
* Tokenize ZPArgVBuf
|
* Tokenize ZPArgVBuf
|
||||||
* :LOOP
|
* :LOOP
|
||||||
* if CmdSep=| :
|
* if CmdSep=| :
|
||||||
|
@ -102,14 +96,23 @@ CORE.Run.EOF jsr CORE.StkPull
|
||||||
jsr IO.Reset
|
jsr IO.Reset
|
||||||
lda #0
|
lda #0
|
||||||
sec
|
sec
|
||||||
rts Ending 0, CS,A=0
|
jmp CORE.Run.Exit Ending 0, CS,A=0
|
||||||
|
|
||||||
.9 lda #E.UNEXPEOF
|
.9 lda #E.UNEXPEOF
|
||||||
sec
|
sec
|
||||||
rts
|
jmp CORE.Run.Exit
|
||||||
|
|
||||||
|
CORE.Run.RTS rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.Run jsr IO.Reset
|
CORE.Run jsr IO.Reset
|
||||||
|
|
||||||
|
>LDYAI 256+16
|
||||||
|
>SYSCALL GetMem
|
||||||
|
bcs CORE.Run.RTS
|
||||||
|
>STYA ZPArgVBuf
|
||||||
|
txa
|
||||||
|
>STA.G CORE.hArgVBuf
|
||||||
|
|
||||||
clc
|
clc
|
||||||
.HS B0 BCS
|
.HS B0 BCS
|
||||||
|
|
||||||
|
@ -117,22 +120,22 @@ CORE.Run.1 sec coming from PIPE OUT
|
||||||
ror
|
ror
|
||||||
>STA.G CORE.bPipeIn
|
>STA.G CORE.bPipeIn
|
||||||
|
|
||||||
>LDYA ZPInputBufPtr Save Actual cmd for looping
|
>LDYA ZPInputBufPtr Save Actual ptr for looping
|
||||||
>STYA ZPInputCmdPtr
|
>STYA ZPInputCmdPtr
|
||||||
|
|
||||||
>LDYA ZPArgVBuf
|
>LDYA ZPArgVBuf Reset ArgV Buffer
|
||||||
>STYA ZPArgVBufPtr
|
>STYA ZPArgVBufPtr
|
||||||
|
|
||||||
lda #0 Reset ArgV Buffer
|
lda #0
|
||||||
sta (ZPArgVBuf)
|
sta (ZPArgVBuf)
|
||||||
dec
|
|
||||||
* lda #$ff
|
sec
|
||||||
sta CORE.IntCmd assume external
|
ror CORE.IntCmd assume external
|
||||||
|
|
||||||
lda #S.PS.F.HOLD
|
lda #S.PS.F.HOLD
|
||||||
sta CORE.PSFlags
|
sta CORE.PSFlags
|
||||||
|
|
||||||
.3 jsr CORE.GetCharNB
|
jsr CORE.GetCharNB
|
||||||
bcs CORE.Run.EOF
|
bcs CORE.Run.EOF
|
||||||
|
|
||||||
cmp #C.CR empty line ?
|
cmp #C.CR empty line ?
|
||||||
|
@ -147,7 +150,7 @@ CORE.Run.1 sec coming from PIPE OUT
|
||||||
|
|
||||||
.8 lda #0
|
.8 lda #0
|
||||||
clc
|
clc
|
||||||
.9 rts EOL, CS,A=0
|
.9 jmp CORE.Run.Exit EOL, CS,A=0
|
||||||
|
|
||||||
.4 >LDYA L.CMD internal command ?
|
.4 >LDYA L.CMD internal command ?
|
||||||
jsr CORE.LookupInputBuf
|
jsr CORE.LookupInputBuf
|
||||||
|
@ -188,7 +191,7 @@ CORE.Run.1 sec coming from PIPE OUT
|
||||||
|
|
||||||
.44 jsr CORE.GetNextCharNB Skip EoL char
|
.44 jsr CORE.GetNextCharNB Skip EoL char
|
||||||
clc
|
clc
|
||||||
.99 rts
|
jmp CORE.Run.Exit
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CORE.Run.5 >LDYA L.CORE.IO
|
CORE.Run.5 >LDYA L.CORE.IO
|
||||||
jsr CORE.LookupInputBuf
|
jsr CORE.LookupInputBuf
|
||||||
|
@ -198,7 +201,7 @@ CORE.Run.5 >LDYA L.CORE.IO
|
||||||
|
|
||||||
jsr CORE.IO.JMP
|
jsr CORE.IO.JMP
|
||||||
bcc CORE.Run.7
|
bcc CORE.Run.7
|
||||||
CORE.Run.RTS rts
|
jmp CORE.Run.Exit
|
||||||
|
|
||||||
CORE.Run.6 jsr CORE.ArgV.Add
|
CORE.Run.6 jsr CORE.ArgV.Add
|
||||||
|
|
||||||
|
@ -225,13 +228,13 @@ CORE.Run.7 jsr CORE.GetCharNB
|
||||||
bpl .3
|
bpl .3
|
||||||
|
|
||||||
jsr IO.Pipe.In
|
jsr IO.Pipe.In
|
||||||
bcs CORE.Run.RTS
|
bcs CORE.Run.Exit
|
||||||
|
|
||||||
.3 >LDA.G CORE.bPipeOut
|
.3 >LDA.G CORE.bPipeOut
|
||||||
bpl CORE.ExecCmd
|
bpl .7
|
||||||
|
|
||||||
jsr IO.Pipe.Out
|
jsr IO.Pipe.Out
|
||||||
bcs CORE.Run.RTS
|
bcs CORE.Run.Exit
|
||||||
|
|
||||||
lda #S.PS.F.HOLD Run in the background...
|
lda #S.PS.F.HOLD Run in the background...
|
||||||
trb CORE.PSFlags
|
trb CORE.PSFlags
|
||||||
|
@ -256,9 +259,22 @@ CORE.Run.7 jsr CORE.GetCharNB
|
||||||
|
|
||||||
.6 pla
|
.6 pla
|
||||||
plp
|
plp
|
||||||
bcs CORE.Run.RTS
|
bcs CORE.Run.Exit
|
||||||
|
|
||||||
jmp CORE.Run.1 Loop with Pipe IN
|
jmp CORE.Run.1 Loop with Pipe IN
|
||||||
|
|
||||||
|
.7 jsr CORE.ExecCmd
|
||||||
|
*--------------------------------------
|
||||||
|
CORE.Run.Exit php
|
||||||
|
pha
|
||||||
|
>LDA.G CORE.hArgVBuf
|
||||||
|
>SYSCALL freemem
|
||||||
|
|
||||||
|
>STZ.G CORE.hArgVBuf
|
||||||
|
|
||||||
|
pla
|
||||||
|
plp
|
||||||
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Input : ZPArgVBuf
|
* Input : ZPArgVBuf
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -267,10 +283,9 @@ CORE.ExecCmd lda #0
|
||||||
>LDYA ZPArgVBuf
|
>LDYA ZPArgVBuf
|
||||||
>STYA ZPArgVBufPtr
|
>STYA ZPArgVBufPtr
|
||||||
|
|
||||||
lda CORE.IntCmd
|
ldx CORE.IntCmd
|
||||||
bmi CORE.ExecExtCmd
|
bmi CORE.ExecExtCmd
|
||||||
|
|
||||||
tax
|
|
||||||
jmp (J.CMD,x)
|
jmp (J.CMD,x)
|
||||||
|
|
||||||
CORE.ExecExtCmd >PUSHB CORE.PSFlags
|
CORE.ExecExtCmd >PUSHB CORE.PSFlags
|
||||||
|
|
17
BIN/SH.S.txt
17
BIN/SH.S.txt
|
@ -310,6 +310,7 @@ CS.RUN.INTERACTIVE
|
||||||
>STZ.G bREAD.S
|
>STZ.G bREAD.S
|
||||||
dec
|
dec
|
||||||
>STA.G READ.N
|
>STA.G READ.N
|
||||||
|
|
||||||
.1 >SYSCALL GetChar
|
.1 >SYSCALL GetChar
|
||||||
bcs .9 I/O error
|
bcs .9 I/O error
|
||||||
.2 cmp #C.EOF ....or Ctrl-D
|
.2 cmp #C.EOF ....or Ctrl-D
|
||||||
|
@ -319,6 +320,7 @@ CS.RUN.INTERACTIVE
|
||||||
|
|
||||||
>LDA.G CL.bReady Something to execute ?
|
>LDA.G CL.bReady Something to execute ?
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
>PUSHBI 0
|
>PUSHBI 0
|
||||||
>LDYA L.MSG.PROMPTCRLF
|
>LDYA L.MSG.PROMPTCRLF
|
||||||
>SYSCALL printf
|
>SYSCALL printf
|
||||||
|
@ -332,14 +334,15 @@ CS.RUN.INTERACTIVE
|
||||||
>SYSCALL strdup
|
>SYSCALL strdup
|
||||||
bcs .8
|
bcs .8
|
||||||
|
|
||||||
jsr GetArgV Y,A =ARGV
|
jsr GetArgV Y,A=ARGV, X=strdup
|
||||||
|
|
||||||
jsr CORE.Load.YAX Exec CL
|
jsr CORE.Load.YAX Exec CL
|
||||||
bcs .9
|
bcs .9
|
||||||
lda #$C0+C.CLEXEC
|
lda #$C0+C.CLEXEC
|
||||||
jsr CORE.StkPush
|
jsr CORE.StkPush
|
||||||
|
|
||||||
.6 jsr CORE.Run
|
jsr CORE.Run
|
||||||
|
|
||||||
.8 jmp CS.RUN.LOOP.END
|
.8 jmp CS.RUN.LOOP.END
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
|
@ -348,17 +351,18 @@ CS.RUN.BATCH >LDA.G bSET.X
|
||||||
beq .5
|
beq .5
|
||||||
|
|
||||||
ldy #$ff
|
ldy #$ff
|
||||||
|
|
||||||
.3 iny
|
.3 iny
|
||||||
lda (ZPInputBufPtr),y
|
lda (ZPInputBufPtr),y
|
||||||
sta (ZPArgVBuf),y
|
sta (ZPCLBuf),y
|
||||||
beq .4
|
beq .4
|
||||||
|
|
||||||
eor #C.CR
|
eor #C.CR
|
||||||
bne .3
|
bne .3
|
||||||
|
|
||||||
sta (ZPArgVBuf),y
|
sta (ZPCLBuf),y
|
||||||
|
|
||||||
.4 >PUSHW ZPArgVBuf
|
.4 >PUSHW ZPCLBuf
|
||||||
>PUSHBI 2
|
>PUSHBI 2
|
||||||
>LDYA L.MSG.TRACE
|
>LDYA L.MSG.TRACE
|
||||||
>SYSCALL printf
|
>SYSCALL printf
|
||||||
|
@ -678,6 +682,9 @@ EXP.OP.BINARY.BITS
|
||||||
.DA #%011
|
.DA #%011
|
||||||
|
|
||||||
EXP.OP.MATH.FPU .DA #FPU.ADD32,#FPU.SUB32,#FPU.IMUL32,#FPU.IDIV32,#FPU.IMOD32
|
EXP.OP.MATH.FPU .DA #FPU.ADD32,#FPU.SUB32,#FPU.IMUL32,#FPU.IDIV32,#FPU.IMOD32
|
||||||
|
*--------------------------------------
|
||||||
|
SET.FLAGS .AS "CXE"
|
||||||
|
SET.VARS .DA #bSET.C,#bSET.X,#bSET.E
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB USR/SRC/SHARED/X.ERRORS.S
|
.INB USR/SRC/SHARED/X.ERRORS.S
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user