2018-01-18 06:49:41 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2018-01-18 06:49:41 +00:00
|
|
|
|
AUTO 4,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)
|
|
|
|
|
bne CMD.CD.1
|
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-02-11 06:58:33 +00:00
|
|
|
|
CMD.CD lda (ZPArgVBufPtr)
|
2019-02-14 16:39:35 +00:00
|
|
|
|
beq CMD.CD.HOME
|
|
|
|
|
|
|
|
|
|
>LDYA ZPArgVBufPtr
|
|
|
|
|
bra CMD.CD.1
|
2019-02-01 16:32:29 +00:00
|
|
|
|
|
|
|
|
|
CMD.CD.HOME >LDYA L.ENV.HOME
|
|
|
|
|
>SYSCALL GetEnv
|
|
|
|
|
bcc CMD.CD.1
|
2017-09-18 15:43:00 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>LDYA L.ENV.ROOT
|
|
|
|
|
>SYSCALL GetEnv
|
2019-02-03 21:58:26 +00:00
|
|
|
|
bcs CMD.PWD
|
2019-01-23 16:26:48 +00:00
|
|
|
|
|
2019-02-14 16:39:35 +00:00
|
|
|
|
CMD.CD.1
|
|
|
|
|
* >DEBUG
|
|
|
|
|
>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-02-15 16:38:17 +00:00
|
|
|
|
stx TmpByte 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-02-15 16:38:17 +00:00
|
|
|
|
lda TmpByte
|
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-02-15 16:38:17 +00:00
|
|
|
|
lda TmpByte
|
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-02-15 16:38:17 +00:00
|
|
|
|
lda TmpByte
|
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-02-01 16:32:29 +00:00
|
|
|
|
>LDA.G bSET.C
|
|
|
|
|
bra .5
|
|
|
|
|
|
|
|
|
|
.2 cmp #'X'
|
|
|
|
|
bne .99
|
|
|
|
|
|
|
|
|
|
>LDA.G bSET.X
|
|
|
|
|
|
|
|
|
|
.5 eor #$ff
|
2019-01-28 16:33:30 +00:00
|
|
|
|
sta (pData),y
|
2019-02-11 06:58:33 +00:00
|
|
|
|
jsr CORE.ArgV.Next
|
|
|
|
|
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
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
>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-02-01 16:32:29 +00:00
|
|
|
|
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.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
|
|
|
|
|
|
|
|
|
|
>PUSHBI S.PS.F.DUPENV
|
|
|
|
|
>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)
|
|
|
|
|
beq .8
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
lda #$ff
|
2019-02-12 16:47:34 +00:00
|
|
|
|
eor ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bra .4
|
|
|
|
|
|
|
|
|
|
.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-12 16:47:34 +00:00
|
|
|
|
bit ZPPtr1
|
2019-02-01 16:32:29 +00:00
|
|
|
|
bmi .8
|
|
|
|
|
|
|
|
|
|
>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
|
|
|
|
|
.9 rts
|
2018-09-17 06:16:45 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.99 lda #E.CSYN
|
|
|
|
|
sec
|
2018-10-15 06:25:40 +00:00
|
|
|
|
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
|
|
|
|
|
tay
|
|
|
|
|
beq .1
|
|
|
|
|
|
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
|
|
|
|
|
lda (ZPArgVBufPtr)
|
|
|
|
|
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.EXIT lda (ZPArgVBufPtr)
|
|
|
|
|
beq .8 no arg, exit 0
|
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 AToL
|
2018-11-26 06:57:11 +00:00
|
|
|
|
bcs .9
|
2018-11-09 15:59:04 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
>PULLL.G M32.ACC
|
|
|
|
|
|
|
|
|
|
lda #$FF
|
|
|
|
|
>STA.G bExit
|
|
|
|
|
|
|
|
|
|
>LDA.G M32.ACC
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 lda #$FF
|
|
|
|
|
>STA.G bExit
|
|
|
|
|
inc
|
2018-11-26 06:57:11 +00:00
|
|
|
|
clc
|
2019-01-28 16:33:30 +00:00
|
|
|
|
.9 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
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.BREAK
|
2019-02-12 16:47:34 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.CONTINUE
|
2019-02-12 16:47:34 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.FOR
|
2019-02-12 16:47:34 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.NEXT
|
2019-02-12 16:47:34 +00:00
|
|
|
|
.9 jmp CMD.Exec.CSYN
|
2019-02-01 16:32:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CMD.WHILE
|
|
|
|
|
CMD.IF jsr CORE.StkGet
|
|
|
|
|
bcs .1 no context...
|
2018-11-12 21:34:55 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
and #$80 get current..
|
|
|
|
|
lsr becomes parent
|
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.1 lda #$40 ...set Parent = true
|
2018-11-12 21:34:55 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.2 >STA.G CORE.Test
|
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
|
|
|
|
|
|
|
|
|
|
jsr CORE.StkPushPtr
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.8 >LDA.G CORE.Test
|
|
|
|
|
>ORA.G CORE.IntCmd
|
|
|
|
|
jmp CORE.StkPush
|
|
|
|
|
|
2018-11-13 15:54:10 +00:00
|
|
|
|
clc
|
2019-01-28 16:33:30 +00:00
|
|
|
|
.9 rts
|
2018-11-24 22:25: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-01 16:32:29 +00:00
|
|
|
|
CMD.LOOP jsr CORE.StkPull
|
|
|
|
|
bcs .9
|
|
|
|
|
tax
|
|
|
|
|
and #$3F
|
|
|
|
|
cmp #C.WHILE
|
|
|
|
|
bne .9
|
2018-10-16 15:48:03 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
txa
|
|
|
|
|
bpl .1
|
2018-11-13 15:54:10 +00:00
|
|
|
|
|
2019-02-01 16:32:29 +00:00
|
|
|
|
jmp CORE.StkPullPtr
|
|
|
|
|
|
|
|
|
|
.1 jsr CORE.StkPull
|
|
|
|
|
bcs .99
|
|
|
|
|
jmp CORE.StkPull
|
|
|
|
|
|
|
|
|
|
.9 lda #E.NOWHILE
|
|
|
|
|
sec
|
|
|
|
|
.99 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-02-11 06:58:33 +00:00
|
|
|
|
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-02-01 16:32:29 +00:00
|
|
|
|
cmp #'a'
|
|
|
|
|
bcc .8
|
|
|
|
|
cmp #'z'+1
|
|
|
|
|
bcs .8
|
|
|
|
|
eor #$20
|
2019-02-11 06:58:33 +00:00
|
|
|
|
jsr CORE.ArgV.NextChar
|
|
|
|
|
jsr CORE.ArgV.NextChar
|
2019-02-01 16:32:29 +00:00
|
|
|
|
.8 clc
|
2018-11-19 16:15:16 +00:00
|
|
|
|
rts
|
|
|
|
|
|
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
|