2018-01-18 06:49:41 +00:00
|
|
|
|
NEW
|
2019-04-15 05:40:13 +00:00
|
|
|
|
AUTO 3,1
|
2015-10-19 20:35:00 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2019-02-03 21:58:26 +00:00
|
|
|
|
CMD.NOHUP >LDA.G CORE.PSFlags
|
|
|
|
|
ora #S.PS.F.NOHUP
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
>LDYA ZPArgVBuf
|
|
|
|
|
jmp CORE.ExecExtCmd
|
2018-11-09 15:59:04 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-01 16:32:29 +00:00
|
|
|
|
CMD.SHIFT lda #1
|
|
|
|
|
|
|
|
|
|
CMD.SHIFTA >SYSCALL ArgV
|
|
|
|
|
bcs .8
|
2018-11-26 10:40:19 +00:00
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
jsr RemoveStrFromArgV
|
2018-11-26 16:36:55 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.7 ldy #S.PS.ARGC
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
dec
|
|
|
|
|
sta (pPS),y
|
2018-11-26 16:36:55 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.PUSHD >LDA.G PUSHD.STACK
|
|
|
|
|
cmp #PUSHD.STACK+PUSHD.STACK.MAX
|
|
|
|
|
beq CMD.POPD.CSYN
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>SYSCALL strdup
|
|
|
|
|
bcs CMD.POPD.CSYN
|
|
|
|
|
|
|
|
|
|
>INC.G PUSHD.STACK
|
|
|
|
|
tay
|
2018-11-26 16:36:55 +00:00
|
|
|
|
txa
|
2019-02-01 16:32:29 +00:00
|
|
|
|
sta (pData),y
|
2018-11-26 16:36:55 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
lda (ZPArgVBufPtr)
|
2019-03-18 16:48:16 +00:00
|
|
|
|
bne CMD.CD.0
|
2018-11-26 16:36:55 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.POPD >LDA.G PUSHD.STACK
|
|
|
|
|
cmp #PUSHD.STACK
|
|
|
|
|
beq CMD.POPD.CSYN
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
2019-02-03 21:58:26 +00:00
|
|
|
|
jsr CMD.SetPrefixA
|
2018-11-26 16:36:55 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>DEC.G PUSHD.STACK
|
|
|
|
|
clc
|
|
|
|
|
CMD.POPD.RTS
|
2018-11-26 16:36:55 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
CMD.POPD.CSYN jmp CMD.Exec.CSYN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.PWD ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>SYSCALL puts
|
|
|
|
|
rts
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-04-03 11:46:50 +00:00
|
|
|
|
CMD... lda (ZPArgVBufPtr)
|
|
|
|
|
bne CMD.POPD.CSYN
|
|
|
|
|
|
|
|
|
|
>LDYA L.CMD
|
|
|
|
|
bra CMD.CD.YA
|
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.CD lda (ZPArgVBufPtr)
|
2019-02-14 16:39:35 +00:00
|
|
|
|
beq CMD.CD.HOME
|
|
|
|
|
|
2019-03-18 16:48:16 +00:00
|
|
|
|
CMD.CD.0 >LDYA ZPArgVBufPtr
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bra CMD.CD.YA
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-04-16 15:54:56 +00:00
|
|
|
|
CMD.CD.HOME >LDYA L.HOME
|
2019-01-23 16:26:48 +00:00
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
CMD.CD.YA >SYSCALL realpath
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bcs CMD.POPD.RTS
|
2019-02-03 21:58:26 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>STYA ZPPtr1
|
2019-04-01 06:07:56 +00:00
|
|
|
|
stx M32.TMP Save hMem
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPPtr1),y
|
2019-02-03 21:58:26 +00:00
|
|
|
|
bne .12
|
2019-01-21 06:52:04 +00:00
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
txa
|
|
|
|
|
jmp CMD.SetPrefixA we have '/'
|
|
|
|
|
|
|
|
|
|
.12 >PUSHEA.G StatBuf
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>LDYA ZPPtr1
|
|
|
|
|
>SYSCALL STAT
|
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
bcs .19
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.10 >LDA.G StatBuf+S.STAT.P.TYPE
|
2019-02-01 16:32:29 +00:00
|
|
|
|
cmp #S.FI.T.DIR
|
2019-02-03 21:58:26 +00:00
|
|
|
|
beq .11
|
|
|
|
|
|
|
|
|
|
lda #MLI.E.INVPATH
|
|
|
|
|
|
|
|
|
|
.19 pha
|
2019-04-01 06:07:56 +00:00
|
|
|
|
lda M32.TMP
|
2019-02-03 21:58:26 +00:00
|
|
|
|
>SYSCALL freemem
|
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.11 ldy #$ff
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
|
|
|
|
.1 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp #'/'
|
2019-02-03 21:58:26 +00:00
|
|
|
|
bne .14
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-04-01 06:07:56 +00:00
|
|
|
|
lda M32.TMP
|
2019-02-03 21:58:26 +00:00
|
|
|
|
jmp CMD.SetPrefixA already ends with a /
|
|
|
|
|
|
|
|
|
|
.14 iny
|
2019-02-01 16:32:29 +00:00
|
|
|
|
iny
|
|
|
|
|
lda #0
|
|
|
|
|
>SYSCALL getmem
|
2019-02-03 21:58:26 +00:00
|
|
|
|
bcs .19
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
|
|
|
|
|
ldy #$ff
|
|
|
|
|
|
|
|
|
|
.2 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
lda (ZPPtr2),y
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
dey
|
|
|
|
|
lda #'/'
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
phx
|
2019-04-01 06:07:56 +00:00
|
|
|
|
lda M32.TMP
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL freemem
|
|
|
|
|
pla
|
|
|
|
|
*--------------------------------------
|
2019-02-03 21:58:26 +00:00
|
|
|
|
CMD.SetPrefixA pha
|
2019-02-01 16:32:29 +00:00
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>SYSCALL FreeMem
|
2019-01-28 16:33:30 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
lda #0
|
|
|
|
|
* clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-02-03 21:58:26 +00:00
|
|
|
|
CMD.Exec.CSYN lda #E.CSYN
|
2018-11-28 11:39:33 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.SET lda (ZPArgVBufPtr)
|
|
|
|
|
bne CMD.SET.1
|
2017-09-11 06:11:57 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
* No arg, print all ENV
|
2016-10-17 15:47:50 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
ldy #S.PS.hENV
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA ZPPTR1
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.1 lda (ZPPTR1)
|
|
|
|
|
beq .8 Ending 0 ?
|
|
|
|
|
|
|
|
|
|
ldy #$ff
|
|
|
|
|
|
|
|
|
|
.2 iny
|
|
|
|
|
lda (ZPPTR1),y
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
sec
|
|
|
|
|
adc ZPPTR1
|
|
|
|
|
sta ZPPTR2
|
2017-09-11 06:11:57 +00:00
|
|
|
|
lda #0
|
2019-02-01 16:32:29 +00:00
|
|
|
|
adc ZPPTR1+1
|
|
|
|
|
sta ZPPTR2+1
|
2018-11-20 15:54:49 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>PUSHW ZPPTR2 Push value
|
|
|
|
|
>PUSHW ZPPTR1 Push name
|
|
|
|
|
jsr CMD.SET.PRINT
|
|
|
|
|
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
ldy #$ff
|
2019-01-23 16:26:48 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.3 iny
|
|
|
|
|
lda (ZPPTR2),y
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
sec
|
|
|
|
|
adc ZPPTR2
|
|
|
|
|
sta ZPPTR1
|
|
|
|
|
lda #0
|
|
|
|
|
adc ZPPTR2+1
|
|
|
|
|
sta ZPPTR1+1
|
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* SET +X VAR = VALUE1 op VALUE2 op VALUE3 ...
|
|
|
|
|
*--------------------------------------
|
2019-02-11 16:44:56 +00:00
|
|
|
|
CMD.SET.1
|
2019-02-11 06:58:33 +00:00
|
|
|
|
.1 jsr CMD.IsSwitch
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bcs .6
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
cmp #'C'
|
2019-01-28 16:33:30 +00:00
|
|
|
|
bne .2
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2019-04-01 15:24:01 +00:00
|
|
|
|
ldy #bSET.C
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bra .5
|
|
|
|
|
|
|
|
|
|
.2 cmp #'X'
|
2019-04-01 15:24:01 +00:00
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
ldy #bSET.X
|
|
|
|
|
bra .5
|
|
|
|
|
|
2019-04-02 15:28:50 +00:00
|
|
|
|
.3 cmp #'E'
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
ldy #bSET.E
|
|
|
|
|
bra .5
|
|
|
|
|
|
|
|
|
|
.4 cmp #'F'
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bne .99
|
|
|
|
|
|
2019-04-01 15:24:01 +00:00
|
|
|
|
jsr CORE.FUNCRESET
|
|
|
|
|
bra .50
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-04-01 15:24:01 +00:00
|
|
|
|
.5 lda (pData),y
|
|
|
|
|
eor #$ff
|
2019-01-28 16:33:30 +00:00
|
|
|
|
sta (pData),y
|
2019-04-01 15:24:01 +00:00
|
|
|
|
.50 jsr CORE.ArgV.Next
|
2019-02-11 06:58:33 +00:00
|
|
|
|
bne .1
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2018-10-11 15:23:06 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
.6 >LDYA ZPArgVBufPtr
|
|
|
|
|
>STYA ZPVarNamePtr
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
jsr CORE.ArgV.Next
|
|
|
|
|
beq CMD.SET.GET
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
|
|
|
|
cmp #'='
|
|
|
|
|
bne .99
|
|
|
|
|
|
|
|
|
|
ldy #1
|
2019-02-11 06:58:33 +00:00
|
|
|
|
lda (ZPArgVBufPtr),y
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bne .99
|
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
jsr CORE.ArgV.Next
|
|
|
|
|
beq CMD.SET.UNSET
|
2019-01-23 16:26:48 +00:00
|
|
|
|
|
2019-02-15 16:38:17 +00:00
|
|
|
|
cmp #'`'
|
|
|
|
|
beq CMD.SET.EXEC
|
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
jsr EXP.GET
|
2019-03-02 22:18:21 +00:00
|
|
|
|
bcs .9
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
|
|
|
|
>PUSHYA
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPVarNamePtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL SetEnv
|
|
|
|
|
rts
|
|
|
|
|
|
2019-01-28 16:33:30 +00:00
|
|
|
|
.8 clc
|
2019-03-02 22:18:21 +00:00
|
|
|
|
.9 rts
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.99 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.SET.UNSET >LDYA ZPVarNamePtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL UnsetEnv
|
|
|
|
|
rts
|
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.SET.GET >LDYA ZPVarNamePtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL GetEnv
|
|
|
|
|
bcc .1
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2019-01-23 16:26:48 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.1 >PUSHYA push value
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPVarNamePtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>PUSHYA push name
|
2019-01-23 16:26:48 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-01 16:32:29 +00:00
|
|
|
|
CMD.SET.PRINT >PUSHBI 4
|
|
|
|
|
>LDYA L.MSG.PRINTENV
|
|
|
|
|
>SYSCALL printf
|
|
|
|
|
rts
|
2019-01-28 16:33:30 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-15 16:38:17 +00:00
|
|
|
|
CMD.SET.EXEC jsr CORE.ArgV.NextChar skip "`"
|
|
|
|
|
|
|
|
|
|
jsr IO.Pipe.Out
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2019-04-15 05:40:13 +00:00
|
|
|
|
>PUSHBI 0
|
2019-02-15 16:38:17 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
|
|
|
|
>SYSCALL execl
|
|
|
|
|
bcs .9
|
|
|
|
|
jsr IO.Pipe.In
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda #$ff
|
2019-02-18 06:42:17 +00:00
|
|
|
|
>STA.G bREAD.S secret
|
2019-02-15 16:38:17 +00:00
|
|
|
|
>STA.G bReadMode
|
|
|
|
|
|
2019-02-18 06:42:17 +00:00
|
|
|
|
>SLEEP
|
|
|
|
|
clc
|
2019-02-15 16:38:17 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2019-02-01 16:32:29 +00:00
|
|
|
|
CMD.DATE sec
|
|
|
|
|
.HS 90 bcc
|
|
|
|
|
CMD.TIME clc
|
|
|
|
|
php
|
|
|
|
|
>LEA.G TimeBuf
|
|
|
|
|
>SYSCALL Time
|
2018-09-17 06:16:45 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>PUSHEA.G TimeBuf
|
2017-01-26 16:28:52 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
plp
|
|
|
|
|
bcc .1
|
|
|
|
|
>PUSHW L.FMT.DATE
|
|
|
|
|
bra .2
|
|
|
|
|
.1 >PUSHW L.FMT.TIME
|
|
|
|
|
|
2019-02-04 14:29:52 +00:00
|
|
|
|
.2 >LEA.G StatBuf
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL StrFTime
|
2017-01-26 16:28:52 +00:00
|
|
|
|
|
2019-02-04 14:29:52 +00:00
|
|
|
|
>LEA.G StatBuf
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL puts
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-02-12 16:47:34 +00:00
|
|
|
|
CMD.ECHO stz ZPPtr1 echo -N
|
2019-02-15 16:38:17 +00:00
|
|
|
|
stz ZPPtr1+1 Token Cnt
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
lda (ZPArgVBufPtr)
|
2019-02-28 21:41:05 +00:00
|
|
|
|
beq .7
|
2019-03-01 14:36:20 +00:00
|
|
|
|
|
2019-02-08 16:13:43 +00:00
|
|
|
|
.1 jsr CMD.IsSwitch
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bcs .2
|
2018-09-17 06:16:45 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
cmp #'N'
|
|
|
|
|
bne .99
|
2019-03-01 15:41:27 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
lda #$ff
|
2019-02-12 16:47:34 +00:00
|
|
|
|
eor ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
2019-03-01 15:41:27 +00:00
|
|
|
|
bra .4
|
2019-02-12 16:47:34 +00:00
|
|
|
|
|
|
|
|
|
.2 lda ZPPtr1+1
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
lda #C.SPACE
|
|
|
|
|
>SYSCALL putchar
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-12 16:47:34 +00:00
|
|
|
|
.3 >PUSHBI 0
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL printf
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2019-02-12 16:47:34 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.4 jsr CORE.ArgV.Next
|
2019-02-11 06:58:33 +00:00
|
|
|
|
bne .1
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-28 21:41:05 +00:00
|
|
|
|
.7 bit ZPPtr1
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bmi .8
|
2019-02-21 14:34:35 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>LDYA L.MSG.ECHOCRLF
|
|
|
|
|
>SYSCALL printf
|
|
|
|
|
rts
|
2017-07-17 05:59:30 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.8 clc
|
2019-03-25 16:51:51 +00:00
|
|
|
|
rts
|
2018-09-17 06:16:45 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.99 lda #E.CSYN
|
|
|
|
|
sec
|
2019-03-25 21:18:50 +00:00
|
|
|
|
.9 rts
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.GETKEY lda (ZPArgVBufPtr)
|
|
|
|
|
beq .99
|
2018-11-28 21:37:18 +00:00
|
|
|
|
|
2019-02-20 16:07:43 +00:00
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL feof
|
|
|
|
|
bcs .9
|
2019-05-02 09:52:32 +00:00
|
|
|
|
|
2019-02-20 16:07:43 +00:00
|
|
|
|
tay
|
2019-05-02 09:52:32 +00:00
|
|
|
|
bne .1
|
2019-02-20 16:07:43 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL getchar
|
2019-02-20 06:30:36 +00:00
|
|
|
|
bcs .9
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
|
|
|
|
.1 >PUSHA
|
|
|
|
|
>PUSHBI 1
|
|
|
|
|
>PUSHW L.FMT.GETKEY
|
|
|
|
|
>LEA.G M32.BUF
|
|
|
|
|
>SYSCALL sprintf
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>PUSHEA.G M32.BUF
|
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL SetEnv
|
|
|
|
|
.9 rts
|
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.99 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.READ lda (ZPArgVBufPtr)
|
|
|
|
|
beq .9
|
2018-11-28 21:37:18 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.1 jsr CMD.IsSwitch
|
|
|
|
|
bcs .4
|
|
|
|
|
cmp #'S'
|
|
|
|
|
bne .2
|
|
|
|
|
|
2019-01-28 16:33:30 +00:00
|
|
|
|
lda #$ff
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>STA.G bREAD.S
|
|
|
|
|
|
|
|
|
|
bra .7
|
|
|
|
|
|
|
|
|
|
.2 cmp #'P'
|
|
|
|
|
bne .9
|
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
jsr CORE.ArgV.Next
|
|
|
|
|
beq .9
|
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>PUSHBI 0
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL printf
|
|
|
|
|
bcs .99
|
|
|
|
|
bra .7
|
|
|
|
|
|
2019-02-18 21:16:49 +00:00
|
|
|
|
.4 >LDYA ZPArgVBufPtr
|
|
|
|
|
>STYA ZPVarNamePtr
|
|
|
|
|
|
2019-02-15 16:38:17 +00:00
|
|
|
|
>LDA.G bReadMode
|
|
|
|
|
bne .9
|
|
|
|
|
lda #$ff
|
|
|
|
|
>STA.G bReadMode
|
2018-11-26 06:57:11 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
.7 jsr CORE.ArgV.Next
|
|
|
|
|
bne .1
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-15 16:38:17 +00:00
|
|
|
|
>LDA.G bReadMode
|
2019-02-01 16:32:29 +00:00
|
|
|
|
beq .9
|
|
|
|
|
clc
|
|
|
|
|
.99 rts
|
2018-11-26 06:57:11 +00:00
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.SLEEP lda (ZPArgVBufPtr)
|
|
|
|
|
beq .9
|
2018-11-26 06:57:11 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL AToL
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>PULLL.G Sleep
|
|
|
|
|
clc
|
2018-11-26 06:57:11 +00:00
|
|
|
|
rts
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2018-11-26 06:57:11 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-01 16:32:29 +00:00
|
|
|
|
CMD.PAUSE lda #$FF
|
|
|
|
|
>STA.G bPause
|
2018-11-26 06:57:11 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.MD lda (ZPArgVBufPtr)
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL MKDir
|
|
|
|
|
rts
|
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.REN lda (ZPArgVBufPtr)
|
|
|
|
|
beq .9
|
|
|
|
|
>PUSHW ZPArgVBufPtr
|
|
|
|
|
|
|
|
|
|
jsr CORE.ArgV.Next
|
|
|
|
|
lda (ZPArgVBufPtr)
|
|
|
|
|
beq .90
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL Rename
|
|
|
|
|
rts
|
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
.90 >PULLYA
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.RD lda (ZPArgVBufPtr)
|
|
|
|
|
beq .9
|
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>PUSHEA.G StatBuf
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL STAT
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>LDA.G StatBuf+S.STAT.P.TYPE
|
|
|
|
|
cmp #S.FI.T.DIR
|
|
|
|
|
bne .9
|
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>SYSCALL Remove
|
|
|
|
|
.99 rts
|
|
|
|
|
|
2019-02-03 21:58:26 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-03-13 16:29:24 +00:00
|
|
|
|
CMD.FUNC lda (ZPArgVBufPtr)
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkGetCtx
|
|
|
|
|
bcc .9 NO context allowed
|
2019-03-15 16:20:28 +00:00
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
lda #3
|
|
|
|
|
jsr CORE.StkCheck
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2019-03-13 16:29:24 +00:00
|
|
|
|
>LDA.G hFuncList
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
>SYSCALL SListNew
|
2019-03-15 16:20:28 +00:00
|
|
|
|
bcs .99
|
2019-03-13 16:29:24 +00:00
|
|
|
|
>STA.G hFuncList
|
|
|
|
|
|
|
|
|
|
.1 >PUSHW ZPArgVBufPtr
|
|
|
|
|
>LDA.G hFuncList
|
|
|
|
|
>SYSCALL SListNewKey
|
|
|
|
|
bcs .99
|
2019-04-03 11:46:50 +00:00
|
|
|
|
jsr CORE.StkPushYA
|
2019-03-13 16:29:24 +00:00
|
|
|
|
|
|
|
|
|
lda #$C0+C.FUNC
|
2019-03-14 16:51:02 +00:00
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
|
|
|
|
lda #$ff
|
|
|
|
|
>STA.G bFuncMode
|
|
|
|
|
clc
|
2019-04-01 15:24:01 +00:00
|
|
|
|
.99 rts
|
2019-03-13 16:29:24 +00:00
|
|
|
|
|
2019-02-12 16:47:34 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-04-03 11:46:50 +00:00
|
|
|
|
CMD.. lda (ZPArgVBufPtr)
|
|
|
|
|
beq .9
|
2019-04-02 15:28:50 +00:00
|
|
|
|
|
2019-04-01 15:24:01 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-04-04 15:44:20 +00:00
|
|
|
|
jsr IO.Load
|
|
|
|
|
bcs CMD.CALL.RTS
|
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-04-05 13:02:42 +00:00
|
|
|
|
jmp CMD.CALL.YAX exec cmd file and continue
|
2019-04-01 15:24:01 +00:00
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-03-12 16:50:16 +00:00
|
|
|
|
*--------------------------------------
|
2019-04-04 15:44:20 +00:00
|
|
|
|
CMD.CALL.UNDEF lda #E.FUNDEF
|
|
|
|
|
sec
|
|
|
|
|
CMD.CALL.RTS rts
|
|
|
|
|
*--------------------------------------
|
2019-04-01 06:07:56 +00:00
|
|
|
|
CMD.CALL >LDA.G hFuncList
|
2019-04-04 15:44:20 +00:00
|
|
|
|
beq CMD.CALL.UNDEF
|
2019-04-01 15:24:01 +00:00
|
|
|
|
|
|
|
|
|
>PUSHW ZPArgVBufPtr
|
2019-04-01 06:07:56 +00:00
|
|
|
|
>LDA.G hFuncList
|
|
|
|
|
>SYSCALL SListLookup
|
2019-04-04 15:44:20 +00:00
|
|
|
|
bcs CMD.CALL.UNDEF
|
2019-04-01 06:07:56 +00:00
|
|
|
|
|
|
|
|
|
>STYA M32.TMP KeyID
|
|
|
|
|
|
|
|
|
|
>PUSHWI 0 From Start
|
|
|
|
|
>PUSHWI $ffff all
|
|
|
|
|
>PUSHWI 0 Allocate..
|
|
|
|
|
>PUSHW M32.TMP KeyID
|
|
|
|
|
>LDA.G hFuncList
|
|
|
|
|
>SYSCALL SListGetData
|
2019-04-04 15:44:20 +00:00
|
|
|
|
bcs CMD.CALL.RTS
|
2019-04-02 15:28:50 +00:00
|
|
|
|
|
|
|
|
|
>LDYA ZPArgVBufPtr FUNC PARAM1 PARAM2...
|
2019-04-04 15:44:20 +00:00
|
|
|
|
|
|
|
|
|
CMD.CALL.YAX stx M32.ACC X=Code to Execute
|
|
|
|
|
|
|
|
|
|
jsr CORE.ArgV.Dup Y,A = ArgV
|
2019-04-06 18:43:33 +00:00
|
|
|
|
bcs CMD.CALL.RTS
|
2019-04-05 15:21:05 +00:00
|
|
|
|
sta M32.ACC+2 A=ARGC
|
2019-04-04 15:44:20 +00:00
|
|
|
|
stx M32.ACC+1 X=ARGV
|
2019-04-06 18:43:33 +00:00
|
|
|
|
|
2019-04-05 15:21:05 +00:00
|
|
|
|
lda #8
|
2019-04-04 15:44:20 +00:00
|
|
|
|
jsr CORE.StkCheck
|
2019-04-06 18:43:33 +00:00
|
|
|
|
bcs CMD.CALL.RTS
|
2019-04-04 15:44:20 +00:00
|
|
|
|
|
|
|
|
|
lda ZPInputBuf
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
|
|
|
|
lda ZPInputBuf+1
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
|
|
|
|
lda ZPInputBufPtr
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
|
|
|
|
lda ZPInputBufPtr+1
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
2019-04-05 15:21:05 +00:00
|
|
|
|
ldy #S.PS.ARGC
|
2019-04-04 15:44:20 +00:00
|
|
|
|
lda (pPS),y
|
2019-04-06 18:43:33 +00:00
|
|
|
|
jsr CORE.StkPush old ARGC
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hARGV
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
jsr CORE.StkPush old ARGV
|
|
|
|
|
|
2019-04-05 15:21:05 +00:00
|
|
|
|
ldy #S.PS.ARGC
|
2019-04-06 18:43:33 +00:00
|
|
|
|
lda M32.ACC+2 new ARGC
|
2019-04-05 15:21:05 +00:00
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
2019-04-06 18:43:33 +00:00
|
|
|
|
iny #S.PS.hARGV
|
|
|
|
|
lda M32.ACC+1
|
|
|
|
|
sta (pPS),y new ARGV
|
2019-04-04 15:44:20 +00:00
|
|
|
|
|
2019-04-05 15:21:05 +00:00
|
|
|
|
lda M32.ACC new code
|
2019-04-04 15:44:20 +00:00
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
lda M32.ACC
|
2019-04-04 15:44:20 +00:00
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA ZPInputBuf
|
|
|
|
|
>STYA ZPInputBufPtr
|
|
|
|
|
|
|
|
|
|
lda #$C0
|
|
|
|
|
jsr CORE.StkPush
|
2019-04-03 11:46:50 +00:00
|
|
|
|
|
2019-04-04 15:44:20 +00:00
|
|
|
|
clc
|
2019-04-06 18:43:33 +00:00
|
|
|
|
CMD.CALL.9 rts
|
2019-04-03 11:46:50 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.EXIT lda (ZPArgVBufPtr)
|
2019-04-06 18:43:33 +00:00
|
|
|
|
beq .1 no arg, exit 0
|
2019-04-03 11:46:50 +00:00
|
|
|
|
|
|
|
|
|
>LDYA ZPArgVBufPtr
|
2019-04-04 15:44:20 +00:00
|
|
|
|
jsr EXP.GET
|
2019-04-06 18:43:33 +00:00
|
|
|
|
bcs CMD.CALL.9
|
2019-04-03 11:46:50 +00:00
|
|
|
|
>SYSCALL AToL
|
2019-04-06 18:43:33 +00:00
|
|
|
|
bcs CMD.CALL.9
|
2019-04-03 11:46:50 +00:00
|
|
|
|
|
2019-04-04 15:44:20 +00:00
|
|
|
|
>PULLA
|
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
2019-04-05 13:02:42 +00:00
|
|
|
|
|
2019-04-06 18:43:33 +00:00
|
|
|
|
.1 jsr CMD.EXIT.A
|
2019-04-05 13:02:42 +00:00
|
|
|
|
bcs .9
|
2019-04-06 18:43:33 +00:00
|
|
|
|
|
2019-04-05 13:02:42 +00:00
|
|
|
|
lda (pData)
|
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
lda #$ff
|
|
|
|
|
>STA.G bExitOnEOF
|
|
|
|
|
|
|
|
|
|
.8 lda M32.ACC
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2019-04-04 15:44:20 +00:00
|
|
|
|
|
|
|
|
|
CMD.EXIT.A sta M32.ACC
|
2019-04-05 05:59:06 +00:00
|
|
|
|
|
2019-04-04 15:44:20 +00:00
|
|
|
|
.1 jsr CORE.StkPull
|
|
|
|
|
bcs CMD.EXIT.RTS
|
2019-04-03 11:46:50 +00:00
|
|
|
|
|
2019-04-04 15:44:20 +00:00
|
|
|
|
cmp #$C0 in CALL / . context ?
|
|
|
|
|
beq .8
|
|
|
|
|
|
2019-04-06 18:43:33 +00:00
|
|
|
|
jsr CMD.EXIT.POP
|
|
|
|
|
bcc .1
|
|
|
|
|
rts
|
2019-04-04 15:44:20 +00:00
|
|
|
|
|
|
|
|
|
.8 jsr CORE.StkPull
|
|
|
|
|
>SYSCALL freemem Code buffer
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hARGV
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL freemem ArgV buffer
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPull
|
|
|
|
|
ldy #S.PS.hARGV
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
2019-04-05 15:21:05 +00:00
|
|
|
|
jsr CORE.StkPull
|
|
|
|
|
ldy #S.PS.ARGC
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
2019-04-04 15:44:20 +00:00
|
|
|
|
jsr CORE.StkPull
|
|
|
|
|
sta ZPInputBufPtr+1
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPull
|
|
|
|
|
sta ZPInputBufPtr
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPull
|
|
|
|
|
sta ZPInputBuf+1
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPull
|
|
|
|
|
sta ZPInputBuf
|
2019-04-05 05:59:06 +00:00
|
|
|
|
|
|
|
|
|
lda M32.ACC
|
2019-04-03 11:46:50 +00:00
|
|
|
|
clc
|
2019-04-04 15:44:20 +00:00
|
|
|
|
CMD.EXIT.RTS rts
|
2019-04-06 18:43:33 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.EXIT.POP and #$3F
|
|
|
|
|
cmp #C.IF
|
2019-04-08 15:39:38 +00:00
|
|
|
|
beq CMD.EXIT.POP0
|
2019-04-06 18:43:33 +00:00
|
|
|
|
|
2019-04-08 15:39:38 +00:00
|
|
|
|
cmp #C.CASE CASE : nothing
|
|
|
|
|
beq CMD.EXIT.POP0
|
2019-04-06 18:43:33 +00:00
|
|
|
|
|
2019-04-08 15:39:38 +00:00
|
|
|
|
ldx #2
|
|
|
|
|
cmp #C.WHILE WHILE : one Ptr
|
|
|
|
|
beq CMD.EXIT.POPX
|
2019-04-06 18:43:33 +00:00
|
|
|
|
|
2019-04-08 15:39:38 +00:00
|
|
|
|
cmp #C.SWITCH SWITCH : hValue
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPull
|
|
|
|
|
>SYSCALL freemem
|
|
|
|
|
clc
|
2019-04-06 18:43:33 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.STACKERROR
|
2019-04-04 15:44:20 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-04-08 15:39:38 +00:00
|
|
|
|
|
|
|
|
|
CMD.EXIT.POPX lda (pData)
|
|
|
|
|
|
|
|
|
|
.1 dec
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
sta (pData)
|
|
|
|
|
|
|
|
|
|
CMD.EXIT.POP0 clc
|
|
|
|
|
rts
|
2019-04-03 11:46:50 +00:00
|
|
|
|
*--------------------------------------
|
2019-03-12 16:50:16 +00:00
|
|
|
|
CMD.BREAK jsr CORE.StkGetCtx Get context in CORE.Test
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.CASE
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
bpl .8
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPull remove C.CASE
|
|
|
|
|
jsr CORE.StkGet
|
|
|
|
|
and #$7F
|
|
|
|
|
sta (pDATA),y
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
2019-03-08 16:36:21 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* stack-1 hVALUE
|
|
|
|
|
* stack SWITCH TOKEN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-03-08 16:36:21 +00:00
|
|
|
|
CMD.SWITCH jsr CORE.StkGetCtx
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
2019-04-04 15:44:20 +00:00
|
|
|
|
lda #2
|
|
|
|
|
jsr CORE.StkCheck
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2019-03-08 16:36:21 +00:00
|
|
|
|
jsr EXP.GET
|
|
|
|
|
bcs .9
|
|
|
|
|
>SYSCALL strdup
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
jsr CORE.StkPush Push EXP hVALUE
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDA.G CORE.Test
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
ora #$80
|
|
|
|
|
|
|
|
|
|
.1 ora #C.SWITCH
|
|
|
|
|
jmp CORE.StkPush
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
2019-03-08 16:36:21 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.CASE jsr CORE.StkGetCtx Get context in CORE.Test
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
2019-03-08 16:36:21 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2019-03-13 16:29:24 +00:00
|
|
|
|
tax
|
|
|
|
|
|
2019-03-08 16:36:21 +00:00
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.SWITCH
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #C.CASE
|
|
|
|
|
bne .9
|
|
|
|
|
|
2019-03-13 16:29:24 +00:00
|
|
|
|
txa previous case was true ?
|
|
|
|
|
bpl .10
|
|
|
|
|
|
|
|
|
|
jsr EXP.GET skip expression
|
|
|
|
|
bcs .9
|
|
|
|
|
rts keep existing context
|
|
|
|
|
|
|
|
|
|
.10 jsr CORE.StkPull remove previous C.CASE
|
2019-03-08 16:36:21 +00:00
|
|
|
|
bra CMD.CASE
|
|
|
|
|
|
|
|
|
|
.1 jsr EXP.GET
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>PUSHYA
|
|
|
|
|
|
|
|
|
|
lda (pDATA)
|
|
|
|
|
tay
|
|
|
|
|
dey get hVALUE
|
|
|
|
|
lda (pDATA),y
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>SYSCALL strcmp
|
|
|
|
|
ror CS if !=
|
|
|
|
|
and #$80
|
|
|
|
|
eor #$80
|
|
|
|
|
>ORA.G CORE.Test
|
|
|
|
|
ora #C.CASE
|
|
|
|
|
jmp CORE.StkPush
|
|
|
|
|
|
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.DEFAULT jsr CORE.StkGetCtx Get context in CORE.Test
|
|
|
|
|
bcs .9
|
2019-03-12 16:50:16 +00:00
|
|
|
|
|
2019-03-08 16:36:21 +00:00
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.SWITCH
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #C.CASE
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPull remove C.CASE
|
|
|
|
|
|
2019-03-12 16:50:16 +00:00
|
|
|
|
.1 jsr CORE.StkGet
|
|
|
|
|
and #$C0
|
2019-03-08 16:36:21 +00:00
|
|
|
|
ora #C.DEFAULT
|
|
|
|
|
jmp CORE.StkPush
|
|
|
|
|
|
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.END jsr CORE.StkGetCtx Get context in CORE.Test
|
|
|
|
|
bcs CMD.END.CSYN
|
|
|
|
|
|
|
|
|
|
and #$3F
|
2019-03-13 16:29:24 +00:00
|
|
|
|
cmp #C.FUNC
|
2019-03-14 16:51:02 +00:00
|
|
|
|
beq CMD.END.FUNC
|
2019-03-13 16:29:24 +00:00
|
|
|
|
|
2019-03-08 16:36:21 +00:00
|
|
|
|
cmp #C.SWITCH
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
cmp #C.CASE
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #C.DEFAULT
|
|
|
|
|
bne CMD.END.CSYN
|
|
|
|
|
|
|
|
|
|
.1 jsr CORE.StkPull remove C.CASE,C.DEFAULT
|
|
|
|
|
|
|
|
|
|
.2 jsr CORE.StkPull remove C.SWITCH
|
|
|
|
|
jsr CORE.StkPull get hVALUE
|
|
|
|
|
>SYSCALL freemem
|
|
|
|
|
rts
|
2019-03-13 16:29:24 +00:00
|
|
|
|
|
2019-03-14 16:51:02 +00:00
|
|
|
|
CMD.END.FUNC jsr CORE.StkPull remove C.FUNC
|
2019-03-13 16:29:24 +00:00
|
|
|
|
jsr CORE.StkPull remove KeyID
|
|
|
|
|
jmp CORE.StkPull remove KeyID
|
2019-03-08 16:36:21 +00:00
|
|
|
|
|
|
|
|
|
CMD.END.CSYN jmp CMD.Exec.CSYN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.FOR jsr CORE.StkGetCtx
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
|
|
|
|
lda (ZPArgVBufPtr)
|
2019-03-08 16:36:21 +00:00
|
|
|
|
beq CMD.END.CSYN
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
>LDYA ZPArgVBufPtr
|
|
|
|
|
>STYA ZPVarNamePtr
|
|
|
|
|
|
|
|
|
|
jsr CORE.ArgV.Next
|
2019-03-08 16:36:21 +00:00
|
|
|
|
beq CMD.END.CSYN
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
jsr ToUpperCase
|
|
|
|
|
cmp #'I'
|
2019-03-08 16:36:21 +00:00
|
|
|
|
bne CMD.END.CSYN
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPArgVBufPtr),y
|
2019-03-08 16:36:21 +00:00
|
|
|
|
beq CMD.END.CSYN
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
jsr ToUpperCase
|
|
|
|
|
cmp #'N'
|
2019-03-08 16:36:21 +00:00
|
|
|
|
bne CMD.END.CSYN
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPArgVBufPtr),y
|
2019-03-08 16:36:21 +00:00
|
|
|
|
bne CMD.END.CSYN
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
2019-03-05 16:49:34 +00:00
|
|
|
|
jsr CORE.ArgV.Next
|
2019-03-08 16:36:21 +00:00
|
|
|
|
beq CMD.END.CSYN
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
2019-04-04 15:44:20 +00:00
|
|
|
|
lda #8
|
|
|
|
|
jsr CORE.StkCheck
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
jsr CORE.StkPushPtr Push CmdPtr AFTER FOR
|
|
|
|
|
|
|
|
|
|
lda (ZPArgVBufPtr)
|
2019-03-06 16:29:51 +00:00
|
|
|
|
cmp #'('
|
|
|
|
|
beq FOR.FILE
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
cmp #'`'
|
2019-03-07 16:48:30 +00:00
|
|
|
|
bne FOR.LIST
|
|
|
|
|
|
|
|
|
|
jmp FOR.EXEC
|
2019-04-04 15:44:20 +00:00
|
|
|
|
.9 rts
|
2019-03-06 16:29:51 +00:00
|
|
|
|
*--------------------------------------
|
2019-04-04 15:44:20 +00:00
|
|
|
|
FOR.LIST >LDYA ZPArgVBufPtr
|
2019-03-05 16:49:34 +00:00
|
|
|
|
>SYSCALL strdup
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
jsr CORE.StkPushYA Push listPtr
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
jsr CORE.StkPush Push hLIST
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
|
|
|
|
>LDYA ZPVarNamePtr
|
|
|
|
|
>SYSCALL strdup
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
|
|
|
|
txa
|
2019-04-03 11:46:50 +00:00
|
|
|
|
jsr CORE.StkPush Push hVARNAME
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
lda #C.FOR.LIST
|
2019-03-05 16:49:34 +00:00
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
lda #C.FOR
|
2019-03-05 16:49:34 +00:00
|
|
|
|
jsr CORE.StkPush
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
|
|
|
|
jsr CMD.NEXT.LIST.1
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
>ORA.G CORE.Test
|
|
|
|
|
ora #C.FOR Push FOR
|
|
|
|
|
pha
|
|
|
|
|
lda (pData)
|
|
|
|
|
tay
|
|
|
|
|
pla
|
|
|
|
|
sta (pData),y
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
* clc
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
.9 rts
|
2019-03-06 16:29:51 +00:00
|
|
|
|
*--------------------------------------
|
2019-04-04 15:44:20 +00:00
|
|
|
|
FOR.FILE jsr CORE.ArgV.NextChar skip "("
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
|
|
|
|
>PUSHWI 0 Aux type
|
|
|
|
|
>PUSHBI S.FI.T.TXT
|
|
|
|
|
>PUSHBI O.RDONLY+O.TEXT
|
|
|
|
|
|
|
|
|
|
>LDYA ZPArgVBufPtr
|
|
|
|
|
>SYSCALL fopen
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs FOR.FILE.9
|
|
|
|
|
jsr CORE.StkPush push hFILE
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
|
|
|
|
>LDYA ZPVarNamePtr
|
|
|
|
|
>SYSCALL strdup
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs FOR.FILE.9
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
|
|
|
|
txa
|
2019-03-07 20:40:06 +00:00
|
|
|
|
jsr CORE.StkPush Push hVARNAME
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
|
|
|
|
lda #C.FOR.FILE
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
|
|
|
|
lda #C.FOR
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
2019-03-11 15:43:33 +00:00
|
|
|
|
jsr CMD.NEXT.LINE
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs FOR.FILE.9
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
|
|
|
|
>ORA.G CORE.Test
|
|
|
|
|
ora #C.FOR Push FOR
|
|
|
|
|
pha
|
|
|
|
|
lda (pData)
|
|
|
|
|
tay
|
|
|
|
|
pla
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
FOR.FILE.9 rts
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-04-04 15:44:20 +00:00
|
|
|
|
FOR.EXEC jsr CORE.ArgV.NextChar skip "`"
|
2019-03-08 11:16:19 +00:00
|
|
|
|
|
|
|
|
|
jsr IO.Pipe.Out
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-08 11:16:19 +00:00
|
|
|
|
|
2019-04-15 05:40:13 +00:00
|
|
|
|
>PUSHBI 0
|
2019-03-08 11:16:19 +00:00
|
|
|
|
>LDYA ZPArgVBufPtr
|
|
|
|
|
>SYSCALL execl
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-08 11:16:19 +00:00
|
|
|
|
|
|
|
|
|
>LDA.G IO.hOut
|
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
|
|
|
|
>STZ.G IO.hOut
|
|
|
|
|
|
|
|
|
|
>PUSHWI 0 auxtype
|
|
|
|
|
>PUSHBI 0 type
|
|
|
|
|
>PUSHBI O.RDONLY+O.TEXT
|
|
|
|
|
>LEA.G IO.NodBuf
|
|
|
|
|
>SYSCALL fopen
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-11 15:43:33 +00:00
|
|
|
|
|
2019-03-08 11:16:19 +00:00
|
|
|
|
jsr CORE.StkPush push hPIPE
|
|
|
|
|
|
|
|
|
|
>LDYA ZPVarNamePtr
|
|
|
|
|
>SYSCALL strdup
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-08 11:16:19 +00:00
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
jsr CORE.StkPush Push hVARNAME
|
|
|
|
|
|
|
|
|
|
lda #C.FOR.EXEC
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
|
|
|
|
lda #C.FOR
|
|
|
|
|
jsr CORE.StkPush
|
|
|
|
|
|
2019-03-11 15:43:33 +00:00
|
|
|
|
jsr CMD.NEXT.LINE
|
2019-04-03 11:46:50 +00:00
|
|
|
|
bcs .9
|
2019-03-08 11:16:19 +00:00
|
|
|
|
|
|
|
|
|
>ORA.G CORE.Test
|
|
|
|
|
ora #C.FOR Push FOR
|
|
|
|
|
pha
|
|
|
|
|
lda (pData)
|
|
|
|
|
tay
|
|
|
|
|
pla
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
|
2019-04-03 11:46:50 +00:00
|
|
|
|
.9 rts
|
2019-03-05 16:49:34 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.NEXT jsr CORE.StkGet Y = StkPtr
|
2019-03-06 16:29:51 +00:00
|
|
|
|
|
2019-03-05 16:49:34 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.FOR
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y
|
2019-03-06 16:29:51 +00:00
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
jmp (J.NEXT,x)
|
|
|
|
|
|
|
|
|
|
.9 lda #E.NOFOR
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* stack-6 CmdPtr
|
|
|
|
|
* stack-4 ListPtr
|
|
|
|
|
* stack-3 hLIST
|
|
|
|
|
* stack-2 hVARNAME
|
2019-03-08 16:36:21 +00:00
|
|
|
|
* stack-1 FOR SUB TOKEN
|
2019-03-06 16:29:51 +00:00
|
|
|
|
* stack FOR TOKEN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.NEXT.LIST lda (pData),y Y = StkPtr
|
|
|
|
|
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
jsr CMD.NEXT.LIST.1
|
|
|
|
|
bcs .9
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
lda (pData)
|
|
|
|
|
sec
|
|
|
|
|
sbc #6
|
|
|
|
|
tay
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
sta ZPInputBufPtr+1
|
2019-03-05 16:49:34 +00:00
|
|
|
|
dey
|
|
|
|
|
lda (pData),y
|
2019-03-06 16:29:51 +00:00
|
|
|
|
sta ZPInputBufPtr
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 lda (pData)
|
|
|
|
|
tay
|
|
|
|
|
sec
|
|
|
|
|
sbc #8
|
|
|
|
|
sta (pData)
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
dey
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y hVARNAME
|
|
|
|
|
pha
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y hLIST
|
|
|
|
|
>SYSCALL freemem
|
|
|
|
|
pla
|
|
|
|
|
>SYSCALL freemem
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.NEXT.LIST.1 lda (pData)
|
|
|
|
|
dec skip FOR
|
|
|
|
|
dec skip SUB TOKEN
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
|
|
|
|
phy
|
|
|
|
|
>SYSCALL GetMemPtr hVARNAME
|
|
|
|
|
>STYA ZPVarNamePtr
|
|
|
|
|
ply
|
|
|
|
|
|
2019-03-05 16:49:34 +00:00
|
|
|
|
dey skip hLIST
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y
|
2019-03-06 16:29:51 +00:00
|
|
|
|
sta ZPPtr1
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y
|
|
|
|
|
sta ZPPtr1+1
|
|
|
|
|
|
2019-03-08 11:16:19 +00:00
|
|
|
|
ldy #0
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-03-08 11:16:19 +00:00
|
|
|
|
.10 lda (ZPPtr1)
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
inc ZPPtr1
|
|
|
|
|
bne .11
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.11 cmp #C.SPACE
|
|
|
|
|
beq .10
|
|
|
|
|
|
|
|
|
|
sta (ZPCLBuf),y
|
|
|
|
|
iny
|
|
|
|
|
|
|
|
|
|
.1 lda (ZPPtr1)
|
2019-03-06 16:29:51 +00:00
|
|
|
|
beq .3
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
|
|
|
|
inc ZPPtr1
|
|
|
|
|
bne .2
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.2 cmp #C.SPACE
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
sta (ZPCLBuf),y
|
2019-03-08 11:16:19 +00:00
|
|
|
|
iny
|
2019-03-05 16:49:34 +00:00
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.3 lda #0
|
|
|
|
|
sta (ZPCLBuf),y
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
beq .8
|
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
>PUSHW ZPCLBuf
|
|
|
|
|
>LDYA ZPVarNamePtr
|
|
|
|
|
>SYSCALL SetEnv
|
|
|
|
|
bcs .9
|
|
|
|
|
|
2019-03-05 16:49:34 +00:00
|
|
|
|
lda (pData)
|
|
|
|
|
sec
|
2019-03-06 16:29:51 +00:00
|
|
|
|
sbc #4
|
2019-03-05 16:49:34 +00:00
|
|
|
|
tay
|
|
|
|
|
lda ZPPtr1
|
|
|
|
|
sta (pData),y
|
2019-03-06 16:29:51 +00:00
|
|
|
|
dey
|
2019-03-05 16:49:34 +00:00
|
|
|
|
lda ZPPtr1+1
|
|
|
|
|
sta (pData),y
|
2019-03-06 16:29:51 +00:00
|
|
|
|
lda #$80
|
2019-03-05 16:49:34 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
.8 >LDYA ZPVarNamePtr
|
|
|
|
|
>SYSCALL UnSetEnv
|
|
|
|
|
bcs .9
|
2019-03-05 16:49:34 +00:00
|
|
|
|
|
2019-03-06 16:29:51 +00:00
|
|
|
|
lda #0
|
|
|
|
|
* clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2019-03-07 16:48:30 +00:00
|
|
|
|
* stack-4 CmdPtr
|
|
|
|
|
* stack-3 hFILE
|
|
|
|
|
* stack-2 hVARNAME
|
|
|
|
|
* stack-1 FOR SUB TOKEN
|
|
|
|
|
* stack FOR TOKEN
|
|
|
|
|
*--------------------------------------
|
2019-03-11 15:43:33 +00:00
|
|
|
|
CMD.NEXT.FILE
|
2019-03-06 16:29:51 +00:00
|
|
|
|
*--------------------------------------
|
2019-03-08 11:16:19 +00:00
|
|
|
|
* stack-4 CmdPtr
|
|
|
|
|
* stack-3 hPIPE
|
|
|
|
|
* stack-2 hVARNAME
|
|
|
|
|
* stack-1 FOR SUB TOKEN
|
|
|
|
|
* stack FOR TOKEN
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.NEXT.EXEC lda (pData),y Y = StkPtr
|
|
|
|
|
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2019-03-11 15:43:33 +00:00
|
|
|
|
jsr CMD.NEXT.LINE
|
2019-03-08 11:16:19 +00:00
|
|
|
|
bcs .9
|
2019-05-07 15:39:35 +00:00
|
|
|
|
bpl .1 end of file/pipe
|
2019-03-08 11:16:19 +00:00
|
|
|
|
|
|
|
|
|
lda (pData)
|
|
|
|
|
sec
|
|
|
|
|
sbc #4
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
lda (pData),y
|
|
|
|
|
sta ZPInputBufPtr+1
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y
|
|
|
|
|
sta ZPInputBufPtr
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.1 lda (pData)
|
|
|
|
|
tay
|
|
|
|
|
sec
|
|
|
|
|
sbc #6
|
|
|
|
|
sta (pData)
|
|
|
|
|
|
|
|
|
|
dey
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y hVARNAME
|
|
|
|
|
pha
|
|
|
|
|
dey
|
2019-03-11 15:43:33 +00:00
|
|
|
|
lda (pData),y hFILE/hPIPE
|
2019-03-08 11:16:19 +00:00
|
|
|
|
>SYSCALL fclose
|
|
|
|
|
pla
|
|
|
|
|
>SYSCALL freemem
|
|
|
|
|
* clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2019-03-11 15:43:33 +00:00
|
|
|
|
CMD.NEXT.LINE lda (pData)
|
2019-03-08 11:16:19 +00:00
|
|
|
|
dec skip FOR
|
|
|
|
|
dec skip SUB TOKEN
|
|
|
|
|
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
|
|
|
|
phy
|
|
|
|
|
>SYSCALL GetMemPtr hVARNAME
|
|
|
|
|
>STYA ZPVarNamePtr
|
|
|
|
|
|
|
|
|
|
>PUSHWI 256
|
|
|
|
|
>PUSHW ZPCLBuf
|
2019-05-07 15:39:35 +00:00
|
|
|
|
ply
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y hFILE/hPIPE
|
2019-03-08 11:16:19 +00:00
|
|
|
|
>SYSCALL fgets
|
|
|
|
|
bcs .8
|
|
|
|
|
|
|
|
|
|
>PUSHW ZPCLBuf
|
|
|
|
|
>LDYA ZPVarNamePtr
|
|
|
|
|
>SYSCALL SetEnv
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda #$80
|
|
|
|
|
* clc
|
2019-03-05 16:49:34 +00:00
|
|
|
|
rts
|
2019-03-08 11:16:19 +00:00
|
|
|
|
|
|
|
|
|
.8 >LDYA ZPVarNamePtr
|
|
|
|
|
>SYSCALL UnSetEnv
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
* clc
|
|
|
|
|
.9 rts
|
2019-03-05 16:49:34 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-01 16:32:29 +00:00
|
|
|
|
CMD.WHILE
|
2019-03-08 16:36:21 +00:00
|
|
|
|
CMD.IF jsr CORE.StkGetCtx
|
2018-11-13 15:54:10 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bit #$40 Parent is true ?
|
|
|
|
|
beq .3
|
2019-02-11 16:44:56 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
jsr EXP.TEST
|
2018-11-13 15:54:10 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.3 >LDA.G CORE.IntCmd
|
|
|
|
|
cmp #C.WHILE
|
|
|
|
|
bne .8
|
|
|
|
|
|
2019-03-05 16:49:34 +00:00
|
|
|
|
clc
|
|
|
|
|
jsr CORE.StkPushPtr Push BEFORE WHILE/IF
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.8 >LDA.G CORE.Test
|
|
|
|
|
>ORA.G CORE.IntCmd
|
|
|
|
|
jmp CORE.StkPush
|
2019-04-03 11:46:50 +00:00
|
|
|
|
|
2019-01-28 16:33:30 +00:00
|
|
|
|
.9 rts
|
2018-11-24 22:25:33 +00:00
|
|
|
|
*--------------------------------------
|
2019-03-04 16:44:33 +00:00
|
|
|
|
CMD.LOOP jsr CORE.StkPull
|
|
|
|
|
bcs .9
|
2019-04-04 15:44:20 +00:00
|
|
|
|
|
2019-03-04 16:44:33 +00:00
|
|
|
|
tax
|
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.WHILE
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
txa
|
2019-03-06 16:29:51 +00:00
|
|
|
|
bmi .8
|
|
|
|
|
|
|
|
|
|
lda (pData)
|
2019-04-04 15:44:20 +00:00
|
|
|
|
dec
|
|
|
|
|
dec Discard loop Ptr
|
2019-03-06 16:29:51 +00:00
|
|
|
|
sta (pData)
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 jmp CORE.StkPullPtr
|
2019-03-04 16:44:33 +00:00
|
|
|
|
|
|
|
|
|
.9 lda #E.NOWHILE
|
|
|
|
|
sec
|
2019-03-06 16:29:51 +00:00
|
|
|
|
rts
|
2019-03-04 16:44:33 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-01 16:32:29 +00:00
|
|
|
|
CMD.ELSE jsr CORE.StkGet
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
bit #$40 parent is true ?
|
|
|
|
|
beq .8 no, skip
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.IF
|
|
|
|
|
bne .9
|
|
|
|
|
txa
|
|
|
|
|
eor #$80 toggle and store at stack ptr
|
|
|
|
|
sta (pData),y
|
2018-11-13 15:54:10 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.8 clc
|
2018-11-13 15:54:10 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.9 lda #E.NOIF
|
2018-11-13 15:54:10 +00:00
|
|
|
|
sec
|
2019-02-01 16:32:29 +00:00
|
|
|
|
rts
|
2018-11-10 17:43:20 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-01 16:32:29 +00:00
|
|
|
|
CMD.FI jsr CORE.StkPull
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.IF
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 lda #E.NOIF
|
|
|
|
|
sec
|
2018-11-24 18:20:48 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-02-11 06:58:33 +00:00
|
|
|
|
CMD.IsSwitch lda (ZPArgVBufPtr)
|
2019-02-01 16:32:29 +00:00
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #1
|
2019-02-11 06:58:33 +00:00
|
|
|
|
lda (ZPArgVBufPtr),y
|
2019-02-01 16:32:29 +00:00
|
|
|
|
beq .9
|
2019-03-01 14:36:20 +00:00
|
|
|
|
|
|
|
|
|
cmp #'0' is -0 ... -9 ?
|
|
|
|
|
bcc .9
|
|
|
|
|
cmp #'9'+1
|
|
|
|
|
bcc .9
|
|
|
|
|
|
|
|
|
|
.1 tax
|
2018-11-19 16:15:16 +00:00
|
|
|
|
iny
|
2019-02-11 06:58:33 +00:00
|
|
|
|
lda (ZPArgVBufPtr),y
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bne .9
|
2018-11-19 16:15:16 +00:00
|
|
|
|
|
2019-02-11 06:58:33 +00:00
|
|
|
|
txa
|
2019-03-05 16:49:34 +00:00
|
|
|
|
jmp ToUpperCase
|
2018-11-19 16:15:16 +00:00
|
|
|
|
|
2019-02-08 16:13:43 +00:00
|
|
|
|
.9 sec
|
2018-11-19 16:15:16 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-10-19 20:35:00 +00:00
|
|
|
|
MAN
|
2019-02-08 16:13:43 +00:00
|
|
|
|
SAVE USR/SRC/BIN/SH.S.CMD
|
|
|
|
|
LOAD USR/SRC/BIN/SH.S
|
2015-10-19 20:35:00 +00:00
|
|
|
|
ASM
|