2015-03-14 21:48:35 +00:00
|
|
|
|
PR#3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
PREFIX /A2OSX.SRC
|
2015-03-14 21:48:35 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2015-10-19 20:35:00 +00:00
|
|
|
|
.LIST OFF
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.TF /A2OSX.BOOT/SBIN/SHELL
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
.INB /A2OSX.DEV/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.DEV/INC/PRODOS.I
|
|
|
|
|
.INB /A2OSX.DEV/INC/A2OSX.I
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
ZPPTR1 .EQ ZPBIN
|
|
|
|
|
ZPPTR2 .EQ ZPBIN+2
|
|
|
|
|
ZPPTR3 .EQ ZPBIN+4
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CmdBuffer.MAX .EQ 127
|
|
|
|
|
*--------------------------------------
|
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
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START Code Length To Relocate
|
|
|
|
|
.DA DS.END-DS.START Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.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
|
2016-10-29 19:58:21 +00:00
|
|
|
|
L.MSG.PROMPT .DA MSG.PROMPT
|
2016-10-17 06:21:04 +00:00
|
|
|
|
L.MSG.ECHO .DA MSG.ECHO
|
2015-11-22 22:30:06 +00:00
|
|
|
|
L.MSG.ERROR .DA MSG.ERROR
|
2016-10-17 15:47:50 +00:00
|
|
|
|
L.MSG.PRINTENV .DA MSG.PRINTENV
|
2015-10-19 20:35:00 +00:00
|
|
|
|
L.ENV.PATH .DA ENV.PATH
|
2016-10-29 19:58:21 +00:00
|
|
|
|
L.ENV.PWD .DA ENV.PWD
|
|
|
|
|
L.ENV.PS1 .DA ENV.PS1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
L.CMD .DA CMD
|
|
|
|
|
L.ARGS .DA ARGS
|
2016-09-05 16:00:11 +00:00
|
|
|
|
L.TIME .DA TIME
|
2016-09-26 16:02:14 +00:00
|
|
|
|
L.STAT .DA STAT
|
2016-09-05 16:00:11 +00:00
|
|
|
|
L.FMT.DATE .DA FMT.DATE
|
|
|
|
|
L.FMT.TIME .DA FMT.TIME
|
2016-08-17 06:25:58 +00:00
|
|
|
|
L.CMDS .DA CMDS
|
|
|
|
|
J.INTCMDS .DA Cmd.Exec.CD
|
|
|
|
|
.DA Cmd.Exec.DATE
|
|
|
|
|
.DA Cmd.Exec.ECHO
|
|
|
|
|
.DA Cmd.Exec.EXIT
|
|
|
|
|
.DA Cmd.Exec.PAUSE
|
2016-10-25 06:58:15 +00:00
|
|
|
|
.DA Cmd.Exec.PWD
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.DA Cmd.Exec.READ
|
|
|
|
|
.DA Cmd.Exec.SET
|
|
|
|
|
.DA Cmd.Exec.STARTPROC
|
|
|
|
|
.DA Cmd.Exec.TIME
|
2016-10-29 19:58:21 +00:00
|
|
|
|
L.ERR.Codes .DA ERR.Codes
|
|
|
|
|
L.ERR.Messages .DA ERR.Messages
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2016-10-29 19:58:21 +00:00
|
|
|
|
CS.INIT jsr SetPWD
|
|
|
|
|
|
|
|
|
|
>SYSCALL GetArgC
|
2016-08-17 06:25:58 +00:00
|
|
|
|
cmp #1
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq CS.INIT.INTERACTIVE no arg, continue starting interactive
|
|
|
|
|
|
|
|
|
|
lda #1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetArgA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
jsr TXT.OpenFileYA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .9
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ldy #bExitOnEOF
|
|
|
|
|
lda #$FF
|
|
|
|
|
sta (pData),y
|
2015-10-19 20:35:00 +00:00
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.INIT.INTERACTIVE
|
2016-08-17 06:25:58 +00:00
|
|
|
|
jsr HIS.Init
|
2015-10-19 20:35:00 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #S.PS.hINDEV
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pPs),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
>PUSHA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
>LDYA L.MSG.GREETINGS
|
2016-11-03 16:26:02 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pPs)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ora #S.PS.F.EVENT Now accept events
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pPs)
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
2015-10-19 20:35:00 +00:00
|
|
|
|
.9 rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.RUN lda #0
|
|
|
|
|
sta (pData)
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.11 ldy #bPause
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .10
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2016-11-08 16:56:05 +00:00
|
|
|
|
.10 ldy #S.PS.RC
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
beq .12
|
|
|
|
|
|
|
|
|
|
jsr ERR.Print
|
|
|
|
|
|
|
|
|
|
.12 ldy #hInputFile batch mode ?
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (pData),y
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
jsr PrintPrompt
|
2015-12-10 18:53:30 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2016-10-24 15:54:43 +00:00
|
|
|
|
.1 >SYSCALL Sleep
|
2015-06-24 20:41:38 +00:00
|
|
|
|
lda (pData)
|
|
|
|
|
bpl .1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
and #$7F
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pData)
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bra .3
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.2 jsr TXT.ReadFile
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .81
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.3 jsr CmdBuffer.Normalize
|
|
|
|
|
lda (pData)
|
|
|
|
|
beq .11 Empty line
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
ldy #hInputFile if batch mode, do not add to cmd history
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda (pData),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bne .4
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
jsr HIS.Add
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.4 >LDYA pData
|
|
|
|
|
jsr Cmd.ExecYA
|
|
|
|
|
bcc .8
|
2016-01-10 22:19:11 +00:00
|
|
|
|
tay
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
2016-10-29 19:58:21 +00:00
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
jsr ERR.Print
|
|
|
|
|
pla
|
|
|
|
|
bcs .99
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.8 ldy #bEXIT
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pData),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .99
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.81 jsr TXT.CloseFile
|
2015-11-23 14:54:30 +00:00
|
|
|
|
ldy #bExitOnEOF
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .8
|
|
|
|
|
lda #0
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.99 sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.DOEVENT ldy #S.EVT.hDEV is Event from active IN device?
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda (pEvent),y
|
|
|
|
|
ldy #S.PS.hINDEV
|
2015-06-03 18:30:57 +00:00
|
|
|
|
cmp (pPs),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .9
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda (pEvent)
|
|
|
|
|
and #S.EVT.F.KEY is it a KEY event?
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATAHI is it an O or SAPPLE key ?
|
|
|
|
|
lda (pEvent),y
|
|
|
|
|
bne .9
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.DATALO
|
|
|
|
|
lda (pEvent),y
|
2015-06-03 18:30:57 +00:00
|
|
|
|
tax
|
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ldy #bPause
|
|
|
|
|
lda (pData),y
|
|
|
|
|
bpl .11
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
2015-12-13 21:29:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
|
|
|
|
.11 ldy #hInputFile Batch mode ?
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .10
|
2015-12-13 21:29:51 +00:00
|
|
|
|
* Batch Mode
|
2015-11-22 22:30:06 +00:00
|
|
|
|
cpx #3 test Ctrl-c
|
|
|
|
|
bne .12
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
jsr TXT.CloseFile
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ldy #bExitOnEOF
|
|
|
|
|
lda (pData),y
|
|
|
|
|
ldy #bExit
|
|
|
|
|
sta (pData),y
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.12 cpx #19 test Ctrl-s
|
|
|
|
|
bne .8
|
|
|
|
|
ldy #bPause
|
|
|
|
|
lda #$80
|
|
|
|
|
sta (pData),y
|
2015-12-13 21:29:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
* interactive mode
|
|
|
|
|
.10 ldy #bEscMode
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .13
|
|
|
|
|
|
|
|
|
|
cpx #'['
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
ldx EscChars
|
|
|
|
|
.17 cmp EscChars,x
|
|
|
|
|
beq .18
|
|
|
|
|
dex
|
|
|
|
|
bne .17
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
2015-12-13 21:29:51 +00:00
|
|
|
|
.18 lda EscAscii,x
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
.13 cpx #$20
|
2015-06-03 18:30:57 +00:00
|
|
|
|
bcs .1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
jsr CS.EVENT.CTRL.CHAR
|
|
|
|
|
bra .8
|
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.1 cpx #$7f
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .2
|
|
|
|
|
jsr CmdBuffer.DEL
|
2015-12-13 21:29:51 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.2 lda (pData) CmdBuffer
|
|
|
|
|
|
|
|
|
|
cmp #CmdBuffer.MAX
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .8
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
inc
|
|
|
|
|
sta (pData)
|
|
|
|
|
tay
|
|
|
|
|
txa
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL COutA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.8 clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.EVENT.CTRL.CHAR
|
2015-11-22 22:30:06 +00:00
|
|
|
|
cpx #13 CR
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .10
|
2015-11-22 22:30:06 +00:00
|
|
|
|
txa
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL COutA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pData) CmdBuffer
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ora #$80
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pData)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2015-12-13 21:29:51 +00:00
|
|
|
|
.10 cpx #$1B esc
|
|
|
|
|
bne .11
|
|
|
|
|
|
|
|
|
|
ldy #bEscMode
|
|
|
|
|
lda #$ff
|
|
|
|
|
sta (pData),y
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.11 cpx #3 Ctrl-C
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
jsr CmdBuffer.CLR
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.1 cpx #8 BS (left arrow)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .2
|
|
|
|
|
jsr CmdBuffer.DEL
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.2 cpx #10 LF (down arrow)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .3
|
|
|
|
|
|
2016-09-22 06:19:49 +00:00
|
|
|
|
jsr HIS.GetNext
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.3 cpx #11 VT (up arrow)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .4
|
|
|
|
|
|
2016-09-22 06:19:49 +00:00
|
|
|
|
jsr HIS.GetPrev
|
2015-03-14 21:48:35 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.4 cpx #21 NAK (right arrow)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .8
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.8 clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-08-17 06:25:58 +00:00
|
|
|
|
CS.QUIT jsr HIS.Quit
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
|
|
|
|
ldy #hInputFile
|
|
|
|
|
lda (pData),y
|
|
|
|
|
beq .1
|
2016-10-29 19:58:21 +00:00
|
|
|
|
>SYSCALL FCloseA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2016-09-26 16:02:14 +00:00
|
|
|
|
.1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.8 clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* PRIVATE
|
|
|
|
|
*--------------------------------------
|
2016-10-29 19:58:21 +00:00
|
|
|
|
SetPWD ldy #S.PS.hPREFIX
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHW L.ENV.PWD
|
|
|
|
|
>SYSCALL SetEnv
|
|
|
|
|
rts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-29 19:58:21 +00:00
|
|
|
|
PrintPrompt >LDYA L.ENV.PS1
|
|
|
|
|
>SYSCALL GetEnvYA
|
|
|
|
|
>SYSCALL ExpandPStrYA
|
|
|
|
|
phx
|
|
|
|
|
>PUSHYA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
pla
|
2016-10-29 19:58:21 +00:00
|
|
|
|
>SYSCALL FreeMemA
|
|
|
|
|
>LDYA L.MSG.PROMPT
|
2016-11-03 16:26:02 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-10-29 19:58:21 +00:00
|
|
|
|
.9 rts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
*--------------------------------------
|
2016-08-17 06:25:58 +00:00
|
|
|
|
* Remove extra SPACE & comment
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CmdBuffer.Normalize
|
|
|
|
|
>LDYA pData
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
lda (pData) empty line...quit
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
tax Char count
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 jsr CmdBuffer.Normalize.Next
|
|
|
|
|
beq .8 no more char, exit
|
|
|
|
|
|
|
|
|
|
cmp #' ' skip leading spaces
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
cmp #'#' Comment ?
|
|
|
|
|
beq .8 ignore remaining chars
|
|
|
|
|
|
|
|
|
|
.3 iny add char to buffer
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
jsr CmdBuffer.Normalize.Next
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
cmp #' '
|
|
|
|
|
bne .3
|
|
|
|
|
|
|
|
|
|
iny add One SPACE to buffer
|
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
.5 jsr CmdBuffer.Normalize.Next
|
|
|
|
|
beq .8
|
|
|
|
|
cmp #' '
|
|
|
|
|
beq .5 skip additional spaces
|
|
|
|
|
bne .3 no more space, add next word...
|
|
|
|
|
|
|
|
|
|
.8 tya
|
|
|
|
|
sta (pData)
|
|
|
|
|
.9 rts
|
|
|
|
|
|
|
|
|
|
CmdBuffer.Normalize.Next
|
|
|
|
|
txa
|
|
|
|
|
beq .8
|
|
|
|
|
dex
|
|
|
|
|
inc ZPPtr1
|
|
|
|
|
bne .1
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
.1 lda (ZPPtr1)
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CmdBuffer.PRINT ldy #0
|
|
|
|
|
.1 iny
|
|
|
|
|
lda (pData),y
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL COutA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
tya
|
|
|
|
|
cmp (pData)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bne .1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CmdBuffer.CLR jsr CmdBuffer.DEL
|
|
|
|
|
bne CmdBuffer.CLR
|
2015-10-19 20:35:00 +00:00
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CmdBuffer.DEL lda (pData)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .9
|
|
|
|
|
lda #8
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL COutA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pData)
|
|
|
|
|
dec
|
|
|
|
|
sta (pData)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.9 rts
|
2015-10-19 20:35:00 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB SBIN/SHELL.S.CMD
|
2016-10-29 19:58:21 +00:00
|
|
|
|
.INB SBIN/SHELL.S.ERR
|
2015-10-19 20:35:00 +00:00
|
|
|
|
.INB SBIN/SHELL.S.HIS
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.INB SBIN/SHELL.S.TXT
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
ENV.PATH >PSTR "PATH"
|
2016-10-29 19:58:21 +00:00
|
|
|
|
ENV.PWD >PSTR "PWD"
|
|
|
|
|
ENV.PS1 >PSTR "PS1"
|
2016-10-24 15:54:43 +00:00
|
|
|
|
CMDS >PSTR "CD"
|
|
|
|
|
>PSTR "DATE"
|
|
|
|
|
>PSTR "ECHO"
|
|
|
|
|
>PSTR "EXIT"
|
|
|
|
|
>PSTR "PAUSE"
|
2016-10-25 06:58:15 +00:00
|
|
|
|
>PSTR "PWD"
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>PSTR "READ"
|
|
|
|
|
>PSTR "SET"
|
|
|
|
|
>PSTR "STARTPROC"
|
|
|
|
|
>PSTR "TIME"
|
2015-10-19 20:35:00 +00:00
|
|
|
|
.HS 00
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
MSG.GREETINGS >CSTR "\nA2osX-Shell on Dev=%h\n\n"
|
2016-10-29 19:58:21 +00:00
|
|
|
|
MSG.PROMPT >CSTR "%S$ "
|
2016-10-24 15:54:43 +00:00
|
|
|
|
MSG.ECHO >CSTR ">%S\n"
|
2016-10-29 19:58:21 +00:00
|
|
|
|
MSG.ERROR >CSTR "%S ($%h)\n"
|
2016-10-24 15:54:43 +00:00
|
|
|
|
FMT.DATE >PSTR "%A, %B %d %Y"
|
|
|
|
|
FMT.TIME >PSTR "%H:%M:%S (%I:%M:%S%p)"
|
|
|
|
|
MSG.PRINTENV >CSTR "%S=%S\n"
|
2016-10-29 19:58:21 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB X.ERRORS.S
|
2016-10-17 15:47:50 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
EscChars >PSTR "DBAC"
|
2015-12-13 21:29:51 +00:00
|
|
|
|
EscAscii .HS 04080A0B15
|
2016-08-17 06:25:58 +00:00
|
|
|
|
CMD .BS 256
|
|
|
|
|
ARGS .BS 256
|
2016-09-26 16:02:14 +00:00
|
|
|
|
TIME .BS S.TIME
|
|
|
|
|
STAT .BS S.STAT
|
2015-06-03 18:30:57 +00:00
|
|
|
|
hNEWPATH .BS 1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
hCmdLine .BS 1
|
|
|
|
|
Cmd.Exec.Mode .BS 1
|
2016-10-27 08:14:13 +00:00
|
|
|
|
hFullPath .BS 1
|
|
|
|
|
hTextFile .BS 1
|
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
|
2015-12-13 21:29:51 +00:00
|
|
|
|
CmdBuffer .BS CmdBuffer.MAX+1 (pData)
|
|
|
|
|
bEscMode .BS 1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bPause .BS 1
|
|
|
|
|
bExit .BS 1
|
2016-01-10 22:19:11 +00:00
|
|
|
|
bEcho .BS 1
|
2015-12-13 21:29:51 +00:00
|
|
|
|
bExitOnEOF .BS 1
|
2015-06-24 20:41:38 +00:00
|
|
|
|
hCmdHistory .BS 1
|
2015-10-19 20:35:00 +00:00
|
|
|
|
CmdHistory.IDX .BS 1
|
2015-12-13 21:29:51 +00:00
|
|
|
|
CmdHistory.END .BS 1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
hInputFile .BS 1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
DS.END
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.ED
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE SBIN/SHELL.S
|
|
|
|
|
ASM
|