A2osX/BIN/SHELL.S.txt

707 lines
13 KiB
Plaintext
Raw Normal View History

2017-12-22 21:24:30 +00:00
NEW
2018-11-17 17:17:13 +00:00
PREFIX
2017-12-22 21:24:30 +00:00
AUTO 4,1
2015-10-19 20:35:00 +00:00
.LIST OFF
2015-03-14 21:48:35 +00:00
.OP 65C02
.OR $2000
2018-11-22 16:39:41 +00:00
.TF BIN/SHELL
2018-11-10 14:30:09 +00:00
*--------------------------------------
2018-12-06 21:58:47 +00:00
CL.MAX .EQ 159
History.MAX .EQ 256
2018-11-19 16:15:16 +00:00
CMD.STACK.MAX .EQ 64
2018-11-26 06:57:11 +00:00
PUSHD.STACK.MAX .EQ 8
*--------------------------------------
C.STARTPROC .EQ 0
2018-11-26 06:57:11 +00:00
C.CD .EQ 2
C.DATE .EQ 4
C.ECHO .EQ 6
C.EXIT .EQ 8
2019-01-23 16:26:48 +00:00
C.GETKEY .EQ 10
C.MD .EQ 12
C.PAUSE .EQ 14
C.PWD .EQ 16
C.RD .EQ 18
C.READ .EQ 20
C.REN .EQ 22
C.SET .EQ 24
C.SLEEP .EQ 26
C.SHIFT .EQ 28
C.TIME .EQ 30
C.PUSHD .EQ 32
C.POPD .EQ 34
C.BREAK .EQ 36
C.CONTINUE .EQ 38
*--------------------------------------
C.FOR .EQ 40
C.NEXT .EQ 42
C.WHILE .EQ 44
C.LOOP .EQ 46
C.IF .EQ 48
C.ELSE .EQ 50
C.FI .EQ 52
2018-11-19 16:15:16 +00:00
*--------------------------------------
2018-11-28 11:39:33 +00:00
E.CSYN .EQ $C0
E.SSYN .EQ $C1
E.ESYN .EQ $C1
E.STKOVERFLOW .EQ $C3
E.NOWHILE .EQ $C4
E.NOFOR .EQ $C5
E.NOIF .EQ $C6
E.BADEXP .EQ $C7
E.BADFTYPE .EQ $C8
2015-03-14 21:48:35 +00:00
*--------------------------------------
2018-07-23 15:28:42 +00:00
.INB INC/MACROS.I
.INB INC/A2OSX.I
2018-10-15 06:25:40 +00:00
.INB INC/MLI.I
2018-10-02 15:52:30 +00:00
.INB INC/MLI.E.I
2015-03-14 21:48:35 +00:00
*--------------------------------------
2019-01-21 06:52:04 +00:00
.DUMMY
2019-01-18 16:06:44 +00:00
.OR ZPBIN
ZS.START
ZPPtr1 .BS 2
ZPPtr2 .BS 2
ZPPtr3 .BS 2
ZPCLBuf .BS 2
ZPArgVBuf .BS 2
ZPFileBufPtr .BS 2
2019-01-21 06:52:04 +00:00
ZPFileBufPtrBak .BS 2
2019-01-18 16:06:44 +00:00
ZPCLBufPtr .BS 2
ZS.END .ED
2015-03-14 21:48:35 +00:00
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
2015-03-14 21:48:35 +00:00
*--------------------------------------
CS.START cld
jmp (.1,x)
2015-06-03 18:30:57 +00:00
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
2018-09-17 06:16:45 +00:00
.DA #S.PS.F.EVENT S.PS.F
.DA #0
2019-01-18 16:06:44 +00:00
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
2015-06-03 18:30:57 +00:00
.DA 0
*--------------------------------------
* Relocation Table
2015-10-19 20:35:00 +00:00
*--------------------------------------
2015-03-14 21:48:35 +00:00
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
*--------------------------------------
L.MSG.GREETINGS .DA MSG.GREETINGS
L.MSG.PROMPT .DA MSG.PROMPT
2018-11-10 14:30:09 +00:00
L.MSG.TRACE .DA MSG.TRACE
2018-09-09 08:11:42 +00:00
L.MSG.ECHOCRLF .DA MSG.ECHOCRLF
2018-11-10 14:30:09 +00:00
L.MSG.BATCHERR .DA MSG.BATCHERR
L.MSG.ERROR .DA MSG.ERROR
L.MSG.PRINTENV .DA MSG.PRINTENV
L.MSG.PID .DA MSG.PID
2018-11-17 17:17:13 +00:00
L.ENV.ROOT .DA ENV.ROOT
2015-10-19 20:35:00 +00:00
L.ENV.PATH .DA ENV.PATH
L.ENV.PWD .DA ENV.PWD
L.ENV.PS1 .DA ENV.PS1
L.ENV.HOME .DA ENV.HOME
L.FMT.DATE .DA FMT.DATE
L.FMT.TIME .DA FMT.TIME
2019-01-23 16:26:48 +00:00
L.FMT.GETKEY .DA FMT.GETKEY
J.ESC .DA CL.BS left arrow
.DA HIS.GetNext
.DA HIS.GetPrev
.DA CL.NAK right arow
2018-11-10 14:30:09 +00:00
L.CL.IO .DA CL.IO
J.CL.IO .DA CL.IO.AMP
.DA CL.IO.PIPE
.DA CL.IO.IN
.DA CL.IO.OUTA
.DA CL.IO.OUT
.DA CL.IO.1OUTA
.DA CL.IO.1OUT
.DA CL.IO.2OUTA
.DA CL.IO.2OUT
2018-09-17 06:16:45 +00:00
L.CMD.INT .DA CMD.INT
2018-10-21 20:54:07 +00:00
J.CMD.INT .DA Cmd.INT.STARTPROC
.DA Cmd.INT.CD
2018-10-15 06:25:40 +00:00
.DA Cmd.INT.DATE
.DA Cmd.INT.ECHO
.DA Cmd.INT.EXIT
2019-01-23 16:26:48 +00:00
.DA Cmd.INT.GETKEY
2018-11-10 14:30:09 +00:00
.DA Cmd.INT.MD
2018-10-15 06:25:40 +00:00
.DA Cmd.INT.PAUSE
.DA Cmd.INT.PWD
2018-11-10 14:30:09 +00:00
.DA Cmd.INT.RD
2018-10-15 06:25:40 +00:00
.DA Cmd.INT.READ
2018-11-15 15:04:14 +00:00
.DA Cmd.INT.REN
2018-10-15 06:25:40 +00:00
.DA Cmd.INT.SET
.DA Cmd.INT.SLEEP
2018-11-20 15:54:49 +00:00
.DA Cmd.INT.SHIFT
2018-10-15 06:25:40 +00:00
.DA Cmd.INT.TIME
2018-11-26 06:57:11 +00:00
.DA Cmd.INT.PUSHD
.DA Cmd.INT.POPD
.DA Cmd.INT.BREAK
.DA Cmd.INT.CONTINUE
.DA Cmd.INT.FOR
2018-11-19 16:15:16 +00:00
.DA Cmd.INT.NEXT
2018-11-26 06:57:11 +00:00
.DA Cmd.INT.WHILE
2018-11-19 16:15:16 +00:00
.DA Cmd.INT.LOOP
2018-11-26 06:57:11 +00:00
.DA Cmd.INT.IF
.DA Cmd.INT.ELSE
.DA Cmd.INT.FI
2018-11-26 06:57:11 +00:00
L.CMD.Eval.TOKEN1 .DA CMD.Eval.TOKEN1
L.CMD.Eval.TOKEN2 .DA CMD.Eval.TOKEN2
J.CMD.Eval.TOKEN2 .DA CMD.Eval.D
.DA CMD.Eval.E
.DA CMD.Eval.F
L.CMD.Eval.TOKEN3 .DA CMD.Eval.TOKEN3
L.CMD.Eval.TOKEN4 .DA CMD.Eval.TOKEN4
J.CMD.Eval.TOKEN4 .DA M32.Add
2018-11-22 07:29:55 +00:00
.DA M32.Sub
.DA M32.Mul
.DA M32.Div
.DA M32.Mod
2019-01-23 16:26:48 +00:00
L.HOME.PROFILE .DA HOME.PROFILE
2018-11-22 16:39:41 +00:00
L.M32.Printf .DA M32.Printf
L.ERR.Codes .DA ERR.Codes
L.ERR.Messages .DA ERR.Messages
2015-03-14 21:48:35 +00:00
.DA 0
*--------------------------------------
2018-11-10 14:30:09 +00:00
CS.INIT clc
CS.INIT.RTS rts
*--------------------------------------
2018-12-03 13:56:52 +00:00
CS.RUN jsr CMD.Init
2018-11-10 14:30:09 +00:00
bcs CS.INIT.RTS
2018-11-22 16:39:41 +00:00
ldy #S.PS.ARGC
lda (pPS),y
beq .1 no arg, continue starting interactive
2018-12-21 14:32:45 +00:00
>PUSHWI 0 Aux type
>PUSHBI S.FI.T.TXT
>PUSHBI O.RDONLY
2018-11-10 14:30:09 +00:00
lda #1
>SYSCALL ArgV
>SYSCALL LoadTxtFile
bcs CS.INIT.RTS
txa
>STA.G hFileBuf
>SYSCALL GetMemPtr
>STYA ZPFileBufPtr
2018-11-10 17:43:20 +00:00
2018-11-20 15:54:49 +00:00
lda #0
2018-11-22 16:39:41 +00:00
jsr ShiftA Remove $0=/bin/shell
2018-11-20 15:54:49 +00:00
2018-11-10 14:30:09 +00:00
bra CS.RUN.LOOP
2018-10-17 15:31:29 +00:00
2018-11-21 13:08:11 +00:00
.1 jsr Cmd.INT.CD.HOME
jsr HIS.Init
2018-11-10 14:30:09 +00:00
bcs CS.INIT.RTS
2018-08-25 11:23:59 +00:00
>PUSHWI K.VER
2018-08-22 15:23:27 +00:00
>PUSHBI 2
>LDYA L.MSG.GREETINGS
2018-06-21 15:12:10 +00:00
>SYSCALL printf
2019-01-23 16:26:48 +00:00
bcs CS.INIT.RTS
>PUSHEA.G CMD.Stat
>LDYA L.HOME.PROFILE
>SYSCALL STAT
bcs CS.RUN.LOOP
2019-01-23 22:03:10 +00:00
>PUSHBI S.PS.F.HOLD
>LDYA L.HOME.PROFILE
>SYSCALL execl
>SLEEP
2015-03-14 21:48:35 +00:00
*--------------------------------------
2018-11-10 14:30:09 +00:00
CS.RUN.LOOP jsr CL.Reset
jsr IO.Reset
2018-11-12 14:48:28 +00:00
.1 jsr CheckSleep
beq .3
>SLEEP
>SYSCALL GetChar
bcs .2
cmp #3 Ctrl-C
bne .1
>LDA.G hFileBuf batch mode ?
2019-01-23 16:26:48 +00:00
beq .1
>LDA.G bSET.C
beq .8
2018-11-12 14:48:28 +00:00
bra .1
2018-11-12 14:48:28 +00:00
.2 tay
beq .1
rts I/O err
2018-08-08 15:13:37 +00:00
2018-11-12 14:48:28 +00:00
.3 >LDA.G bPause
bpl .6
.4 >SLEEP
2018-11-10 14:30:09 +00:00
>SYSCALL GetChar
2018-11-12 14:48:28 +00:00
bcc .5 got one
2018-11-10 14:30:09 +00:00
tay
2018-11-12 14:48:28 +00:00
beq .4 no char
rts I/O err
2018-11-10 14:30:09 +00:00
2018-11-12 14:48:28 +00:00
.5 cmp #3 Ctrl-C
bne .60
>LDA.G hFileBuf batch mode ?
2019-01-23 16:26:48 +00:00
beq .61
>LDA.G bSET.C
beq .8
bra .61
2018-11-12 14:48:28 +00:00
.60 cmp #C.CR
bne .4
2018-11-10 14:30:09 +00:00
.61 >STZ.G bPause
bra .62
.6 >LDA.G hVarName read mode ?
2018-11-12 14:48:28 +00:00
bne .7
.62 >LDA.G hFileBuf batch mode ?
2018-12-03 06:59:30 +00:00
beq CS.RUN.INTERACTIVE
jmp CS.RUN.BATCH
2018-11-10 14:30:09 +00:00
.7 jmp CS.RUN.READ
2018-11-07 16:11:02 +00:00
2018-11-12 14:48:28 +00:00
.8 lda #3 User Interrupt
2018-11-10 14:30:09 +00:00
.9 sec
rts
*--------------------------------------
2018-12-03 06:59:30 +00:00
CS.RUN.INTERACTIVE
2018-09-25 06:25:32 +00:00
jsr CL.PrintPrompt
bcs .9
.1 >SLEEP
>SYSCALL GetChar
2018-11-12 14:48:28 +00:00
bcc .2
2018-07-18 15:30:42 +00:00
2018-09-19 15:25:42 +00:00
tay
2018-11-10 14:30:09 +00:00
beq .1 no char
2018-10-24 15:36:45 +00:00
2018-11-12 16:19:44 +00:00
.9 rts I/O error
2018-11-12 14:48:28 +00:00
.2 cmp #C.EOF ....or Ctrl-D
beq .9 CS
2018-09-19 15:25:42 +00:00
2018-07-19 15:33:55 +00:00
jsr CL.CHARIN
2017-01-12 17:43:45 +00:00
2018-11-10 14:30:09 +00:00
>LDA.G CL.bExec Something to execute ?
2015-06-24 20:41:38 +00:00
bpl .1
lda (ZPCLBuf)
2018-11-12 14:48:28 +00:00
beq .8 Empty line
2018-10-29 08:41:10 +00:00
2018-10-23 15:36:57 +00:00
jsr HIS.Add
2018-11-10 14:30:09 +00:00
jmp CS.RUN.Exec
2018-11-12 14:48:28 +00:00
.8 jmp CS.RUN.LOOP
*--------------------------------------
2018-11-10 14:30:09 +00:00
CS.RUN.READ
.1 >SLEEP
>SYSCALL GetChar
bcs .1 no char
jsr CL.CHARIN
2018-11-10 14:30:09 +00:00
>LDA.G CL.bExec
bpl .1
lda (ZPCLBuf)
bne .2
>LDA.G hVarName
>SYSCALL GetMemPtr
>SYSCALL UnSetEnv
bra .7
2018-09-17 06:16:45 +00:00
.2 >PUSHW ZPCLBuf
>LDA.G hVarName
>SYSCALL GetMemPtr
>SYSCALL SetEnv
2018-09-17 06:16:45 +00:00
.7 php
pha
>LDA.G hVarName
>SYSCALL freemem
>STZ.G hVarName
>STA.G bREAD.S
pla
plp
2018-11-10 14:30:09 +00:00
.8 jmp CS.RUN.LOOP.END
*--------------------------------------
CS.RUN.BATCH >SYSCALL GetChar
bcs .2
cmp #3 test Ctrl-c
bne .1
2018-11-10 14:30:09 +00:00
* sec
.9 rts
.1 cmp #19 test Ctrl-s
bne .2
lda #$80
>STA.G bPause
2018-11-28 21:37:18 +00:00
clc
2018-11-12 16:19:44 +00:00
jmp CS.RUN.LOOP.END
2019-01-21 06:52:04 +00:00
.2 jsr CL.GetLine
bcc .7
2018-12-03 06:59:30 +00:00
2018-11-10 14:30:09 +00:00
cmp #C.EOF
bne .3
2018-11-10 14:30:09 +00:00
lda #$ff
>STA.G bExit
inc
clc
bra CS.RUN.LOOP.END
2018-11-10 14:30:09 +00:00
.3 sec
bra CS.RUN.LOOP.END
2018-12-03 13:56:52 +00:00
.7 >LDA.G CL.bExec
2018-11-10 14:30:09 +00:00
bpl CS.RUN.LOOP.80
lda (ZPCLBuf)
2018-11-10 14:30:09 +00:00
beq CS.RUN.LOOP.80
2018-10-29 08:41:10 +00:00
>LDA.G bSET.X
beq CS.RUN.Exec
>PUSHW ZPCLBuf
>PUSHBI 2
>LDYA L.MSG.TRACE
>SYSCALL printf
2018-12-21 14:32:45 +00:00
bcs .9
2018-11-10 14:30:09 +00:00
*--------------------------------------
CS.RUN.Exec jsr CL.Parse
2018-11-11 22:05:04 +00:00
bcs CS.RUN.LOOP.END
2018-10-23 15:36:57 +00:00
2018-10-21 20:54:07 +00:00
lda (ZPArgVBuf)
2018-11-10 14:30:09 +00:00
beq CS.RUN.LOOP.8
2018-09-17 06:16:45 +00:00
jsr CMD.Exec
2018-11-10 14:30:09 +00:00
*--------------------------------------
CS.RUN.LOOP.END ldy #S.PS.RC
sta (pPs),y
bcc CS.RUN.LOOP.8
2018-11-10 14:30:09 +00:00
>LDA.G hFileBuf batch mode ?
beq .1
2018-11-10 14:30:09 +00:00
jsr IO.PrintBatchErrMsg
bcs CS.RUN.LOOP.RTS
.1 ldy #S.PS.RC
lda (pPs),y
2018-11-10 14:30:09 +00:00
jsr IO.PrintErrMsg
bcs CS.RUN.LOOP.RTS
CS.RUN.LOOP.8 >LDA.G bExit
beq CS.RUN.LOOP.80
2018-12-05 15:12:10 +00:00
ldy #S.PS.RC
lda (pPs),y
sec
2018-11-10 14:30:09 +00:00
CS.RUN.LOOP.RTS rts
CS.RUN.LOOP.80 jmp CS.RUN.LOOP
2015-03-14 21:48:35 +00:00
*--------------------------------------
CS.DOEVENT lda (pEvent)
bpl .9
jsr CheckSleep
beq .9
* ldy #Sleep already set by CheckSleep
2018-11-12 14:48:28 +00:00
ldx #4
clc
.1 lda (pData),y
sbc #0
sta (pData),y
iny
2018-11-12 14:48:28 +00:00
dex
bne .1
.9 sec
2015-12-13 21:29:51 +00:00
rts
2017-01-12 17:43:45 +00:00
*--------------------------------------
2019-01-21 06:52:04 +00:00
CS.QUIT jsr HIS.Quit
jsr CMD.Quit
clc
2015-03-14 21:48:35 +00:00
rts
*--------------------------------------
CheckSleep ldy #Sleep+3
lda (pData),y
dey
ora (pData),y
dey
ora (pData),y
dey
ora (pData),y
rts
2015-03-14 21:48:35 +00:00
*--------------------------------------
2018-11-20 15:54:49 +00:00
ShiftA >SYSCALL ArgV
bcs .8
>STYA ZPPtr1
>STYA ZPPtr2
.10 ldy #$ff
.1 iny Compute ArgX len
lda (ZPPtr1),y
bne .1
.2 tya
sec
adc ZPPtr1
sta ZPPtr1
bcc .3
inc ZPPtr1+1
.3 ldy #$ff
.4 iny
lda (ZPPtr1),y
sta (ZPPtr2),y
bne .4
tya
beq .7
sec
adc ZPPtr2
sta ZPPtr2
bcc .2
inc ZPPtr2+1
bra .2
.7 ldy #S.PS.ARGC
lda (pPS),y
dec
sta (pPS),y
.8 clc
rts
*--------------------------------------
2018-11-10 14:30:09 +00:00
Lookup >STYA ZPPtr2
>PULLW ZPPtr1
ldx #0
.1 phx
>PUSHW ZPPtr2
>LDYA ZPPtr1
>SYSCALL StrCaseCmp
bcs .2
plx
>LDYA ZPPtr2
clc
rts
.2 inc ZPPtr2
bne .3
inc ZPPtr2+1
.3 lda (ZPPtr2)
bne .2
inc ZPPtr2
bne .4
inc ZPPtr2+1
.4 plx
inx
inx
lda (ZPPtr2) Array Ending 0, must be an external Cmd....
bne .1
sec
rts
*--------------------------------------
2018-11-22 16:39:41 +00:00
.INB USR/SRC/BIN/SHELL.S.CL
.INB USR/SRC/BIN/SHELL.S.CMD
.INB USR/SRC/BIN/SHELL.S.IO
.INB USR/SRC/BIN/SHELL.S.HIS
2015-03-14 21:48:35 +00:00
*--------------------------------------
CS.END
*--------------------------------------
2018-09-17 06:16:45 +00:00
MSG.GREETINGS .AZ "\r\nA2osX-Shell %d.%d\r\n\r\n"
MSG.PROMPT .AZ "\e[7h$ "
2018-12-21 14:32:45 +00:00
MSG.TRACE .AZ ">%s\r\n"
2018-11-10 14:30:09 +00:00
MSG.BATCHERR .AZ "^\r\nLine #%D:"
2018-11-27 21:26:03 +00:00
MSG.ERROR .AS "[$%h]:%S."
MSG.ECHOCRLF .AZ "\r\n"
2018-11-20 15:54:49 +00:00
MSG.PRINTENV .AZ "%s = %s\r\n"
MSG.PID .AZ "PID=%d\r\n"
2018-09-17 06:16:45 +00:00
FMT.DATE .AZ "%A (%w), %B %d %Y"
FMT.TIME .AZ "%H:%M:%S (%I:%M:%S%p)"
2019-01-23 16:26:48 +00:00
FMT.GETKEY .AZ "%d"
2018-09-17 06:16:45 +00:00
*--------------------------------------
2018-11-17 17:17:13 +00:00
ENV.ROOT .AZ "ROOT"
ENV.PATH .AZ "PATH"
ENV.PWD .AZ "PWD"
ENV.PS1 .AZ "PS1"
ENV.HOME .AZ "HOME"
2019-01-23 16:26:48 +00:00
HOME.PROFILE .AZ "${HOME}PROFILE"
*--------------------------------------
2018-09-14 14:29:47 +00:00
* https://www.tldp.org/LDP/abs/html/io-redirection.html
*--------------------------------------
2018-11-10 14:30:09 +00:00
CL.IO .AZ "&"
.AZ "|"
.AZ "<"
.AZ ">>"
.AZ ">"
.AZ "1>>"
.AZ "1>"
.AZ "2>>"
.AZ "2>"
.HS 00
*--------------------------------------
2018-10-21 20:54:07 +00:00
CMD.INT .AZ "STARTPROC"
.AZ "CD"
.AZ "DATE"
.AZ "ECHO"
.AZ "EXIT"
2019-01-23 16:26:48 +00:00
.AZ "GETKEY"
2018-11-10 14:30:09 +00:00
.AZ "MD"
.AZ "PAUSE"
.AZ "PWD"
2018-11-10 14:30:09 +00:00
.AZ "RD"
.AZ "READ"
2018-11-15 15:04:14 +00:00
.AZ "REN"
.AZ "SET"
.AZ "SLEEP"
2018-11-20 15:54:49 +00:00
.AZ "SHIFT"
.AZ "TIME"
2018-11-26 06:57:11 +00:00
.AZ "PUSHD"
.AZ "POPD"
.AZ "BREAK"
.AZ "CONTINUE"
.AZ "FOR"
2018-11-19 16:15:16 +00:00
.AZ "NEXT"
2018-11-26 06:57:11 +00:00
.AZ "WHILE"
2018-11-19 16:15:16 +00:00
.AZ "LOOP"
2018-11-26 06:57:11 +00:00
.AZ "IF"
.AZ "ELSE"
.AZ "FI"
2015-10-19 20:35:00 +00:00
.HS 00
*--------------------------------------
2018-11-26 06:57:11 +00:00
CMD.Eval.TOKEN1 .AZ "!["
.AZ "["
2018-11-09 15:59:04 +00:00
.HS 00
2018-11-26 06:57:11 +00:00
CMD.Eval.TOKEN2 .AZ "-d"
2018-11-09 15:59:04 +00:00
.AZ "-e"
.AZ "-f"
.HS 00
2018-11-26 06:57:11 +00:00
CMD.Eval.TOKEN3 .AZ "="
.AZ "!="
.AZ "-eq"
2018-11-09 15:59:04 +00:00
.AZ "-ne"
.AZ "-lt"
.AZ "-le"
.AZ "-gt"
.AZ "-ge"
.HS 00
2018-11-26 06:57:11 +00:00
CMD.Eval.TOKEN3.BITS
.DA #%000
.DA #%000
.DA #%010
2018-11-26 10:40:19 +00:00
.DA #%101
.DA #%100
.DA #%110
.DA #%001
.DA #%011
2018-11-26 06:57:11 +00:00
CMD.Eval.TOKEN4 .AZ "+"
.AZ "-"
.AZ "*"
.AZ "div"
.AZ "mod"
.HS 00
*--------------------------------------
2018-11-21 07:09:22 +00:00
.INB USR/SRC/X.M32.S
2018-11-17 17:17:13 +00:00
.INB USR/SRC/X.ERRORS.S
*--------------------------------------
EscChars .AS 'DBAC'
2018-09-14 13:08:30 +00:00
EscChars.Cnt .EQ *-EscChars
2018-11-22 16:39:41 +00:00
M32.Printf .AZ "%L"
2015-03-14 21:48:35 +00:00
*--------------------------------------
2015-06-03 18:30:57 +00:00
.DUMMY
.OR 0
2015-03-14 21:48:35 +00:00
DS.START
2018-11-26 06:57:11 +00:00
CMD.STACK .BS CMD.STACK.MAX+1 pData (0 = Stack Ptr)
PUSHD.STACK .BS PUSHD.STACK.MAX+1
2018-11-19 16:15:16 +00:00
hFileBuf .BS 1 batch mode
hVarName .BS 1 read mode
2015-12-13 21:29:51 +00:00
bEscMode .BS 1
bPause .BS 1
bExit .BS 1
2019-01-23 16:26:48 +00:00
bSET.C .BS 1
2018-10-16 15:48:03 +00:00
bSET.X .BS 1
bECHO.N .BS 1
bREAD.S .BS 1
Sleep .BS 4
2018-11-10 14:30:09 +00:00
CL.Ptr .BS 1
CL.Len .BS 1
CL.bExec .BS 1
CMD.hCLBuf .BS 1
2018-10-29 08:41:10 +00:00
CMD.IntCmd .BS 1
2018-10-19 15:26:21 +00:00
CMD.hArgVBuf .BS 1
2018-10-15 06:25:40 +00:00
CMD.ArgIndex .BS 1
2018-11-20 15:54:49 +00:00
CMD.Varname .BS 1
2018-11-19 16:15:16 +00:00
CMD.Test .BS 1
CMD.Operator .BS 1
2018-10-15 06:25:40 +00:00
CMD.PSFlags .BS 1
CMD.Stat .BS S.STAT
CMD.Time .BS S.TIME
2018-11-09 15:59:04 +00:00
HIS.hBuf .BS 1
HIS.Count .BS 1
HIS.Index .BS 1
IO.hIn .BS 1
IO.hOut .BS 1
IO.hErr .BS 1
2019-01-21 06:52:04 +00:00
*--------------------------------------
2018-11-22 16:39:41 +00:00
M32.BUF .BS 12 -1234567890\0
2018-11-21 07:09:22 +00:00
M32.ACC .BS 4
M32.ARG .BS 4
M32.TMP .BS 4
DS.END .ED
2015-03-14 21:48:35 +00:00
*--------------------------------------
MAN
2018-11-22 16:39:41 +00:00
SAVE USR/SRC/BIN/SHELL.S
2015-03-14 21:48:35 +00:00
ASM