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
|
2016-10-29 19:58:21 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2018-11-07 16:11:02 +00:00
|
|
|
|
IO.Reset jsr IO.Reset.In
|
|
|
|
|
jsr IO.Reset.Out
|
|
|
|
|
jsr IO.Reset.Err
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-02-04 16:37:15 +00:00
|
|
|
|
IO.Pipe.In
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IO.Pipe.Out
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-11-07 16:11:02 +00:00
|
|
|
|
IO.Set.In pha
|
|
|
|
|
jsr IO.Reset.In
|
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>STA.G IO.hIn
|
|
|
|
|
pla
|
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IO.Reset.In >LDA.G IO.hIn
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fclose
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
|
|
|
|
>STZ.G IO.hIn
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IO.Set.Out pha
|
|
|
|
|
jsr IO.Reset.Out
|
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>STA.G IO.hOut
|
|
|
|
|
pla
|
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IO.Reset.Out >LDA.G IO.hOut
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fclose
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
|
|
|
|
>STZ.G IO.hOut
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IO.Set.Err pha
|
|
|
|
|
jsr IO.Reset.Err
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>STA.G IO.hErr
|
|
|
|
|
pla
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
IO.Reset.Err >LDA.G IO.hErr
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fclose
|
|
|
|
|
|
|
|
|
|
pla
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
|
|
|
|
>STZ.G IO.hErr
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2018-11-10 14:30:09 +00:00
|
|
|
|
IO.PrintBatchErrMsg
|
|
|
|
|
>LDA.G hFileBuf
|
|
|
|
|
>SYSCALL GetMemPtr
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
stz ZPPtr3
|
|
|
|
|
stz ZPPtr3+1
|
|
|
|
|
|
|
|
|
|
.1 >LDYA ZPPtr1
|
|
|
|
|
>STYA ZPPtr2 Save actual line start
|
|
|
|
|
|
|
|
|
|
inc ZPPtr3
|
|
|
|
|
bne .2
|
|
|
|
|
inc ZPPtr3+1
|
|
|
|
|
|
|
|
|
|
.2 lda (ZPPtr1)
|
|
|
|
|
beq .6 EoF
|
|
|
|
|
inc ZPPtr1
|
|
|
|
|
bne .3
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.3 cmp #$0D
|
|
|
|
|
bne .2 Scan until EoL
|
|
|
|
|
|
|
|
|
|
ldx ZPPtr1
|
2019-02-04 14:29:52 +00:00
|
|
|
|
cpx ZPInputBufPtr
|
2018-11-10 14:30:09 +00:00
|
|
|
|
lda ZPPtr1+1
|
2019-02-04 14:29:52 +00:00
|
|
|
|
sbc ZPInputBufPtr+1
|
2018-11-10 14:30:09 +00:00
|
|
|
|
bcc .1 not this line....
|
|
|
|
|
|
|
|
|
|
.4 ldy #0
|
|
|
|
|
|
|
|
|
|
.5 lda (ZPPtr2),y
|
|
|
|
|
beq .6
|
|
|
|
|
iny
|
|
|
|
|
cmp #$0D
|
|
|
|
|
beq .6
|
|
|
|
|
phy
|
2018-11-27 21:26:03 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fputc
|
2018-11-10 14:30:09 +00:00
|
|
|
|
ply
|
|
|
|
|
bra .5
|
|
|
|
|
|
2018-11-27 21:26:03 +00:00
|
|
|
|
.6 >PUSHBI 0
|
|
|
|
|
>PUSHW L.MSG.ECHOCRLF
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fprintf
|
|
|
|
|
|
2019-02-04 14:29:52 +00:00
|
|
|
|
lda ZPInputBufPtr
|
2018-11-10 14:30:09 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc ZPPtr2
|
|
|
|
|
beq .8
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.7 phy
|
2018-11-27 21:26:03 +00:00
|
|
|
|
>PUSHBI '-'
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fputc
|
2018-11-10 14:30:09 +00:00
|
|
|
|
ply
|
|
|
|
|
dey
|
|
|
|
|
bne .7
|
|
|
|
|
|
|
|
|
|
.8 >PUSHW ZPPtr3
|
|
|
|
|
|
|
|
|
|
>PUSHBI 2
|
2018-11-27 21:26:03 +00:00
|
|
|
|
>PUSHW L.MSG.BATCHERR
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fprintf
|
2018-11-10 14:30:09 +00:00
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-09-11 15:29:08 +00:00
|
|
|
|
IO.PrintErrMsg pha Save EC for PrintF
|
2016-10-29 19:58:21 +00:00
|
|
|
|
|
|
|
|
|
ldx L.ERR.Codes
|
|
|
|
|
stx ZPPTR1
|
|
|
|
|
ldx L.ERR.Codes+1
|
|
|
|
|
stx ZPPTR1+1
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
|
|
|
|
.1 cmp (ZPPTR1),y
|
|
|
|
|
beq .2
|
|
|
|
|
iny
|
|
|
|
|
cpy #ERR.Count
|
|
|
|
|
bne .1
|
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
.2 lda L.ERR.Messages
|
2016-10-29 19:58:21 +00:00
|
|
|
|
sta ZPPTR1
|
|
|
|
|
lda L.ERR.Messages+1
|
|
|
|
|
sta ZPPTR1+1
|
|
|
|
|
|
2017-03-19 21:47:54 +00:00
|
|
|
|
.3 dey
|
|
|
|
|
bmi .8
|
2018-07-13 14:38:24 +00:00
|
|
|
|
|
2016-10-29 19:58:21 +00:00
|
|
|
|
lda (ZPPTR1)
|
|
|
|
|
sec
|
|
|
|
|
adc ZPPTR1
|
|
|
|
|
sta ZPPTR1
|
2017-03-19 21:47:54 +00:00
|
|
|
|
bcc .3
|
2016-10-29 19:58:21 +00:00
|
|
|
|
inc ZPPTR1+1
|
|
|
|
|
bra .3
|
|
|
|
|
|
2018-11-08 14:23:06 +00:00
|
|
|
|
.8 >PUSHW ZPPTR1
|
2017-09-11 15:29:08 +00:00
|
|
|
|
pla
|
|
|
|
|
>PUSHA
|
2018-10-08 05:55:28 +00:00
|
|
|
|
>PUSHBI 3
|
|
|
|
|
>PUSHW L.MSG.ERROR
|
|
|
|
|
ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL fprintf
|
2016-10-29 19:58:21 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2018-11-22 16:39:41 +00:00
|
|
|
|
SAVE USR/SRC/BIN/SHELL.S.IO
|
|
|
|
|
LOAD USR/SRC/BIN/SHELL.S
|
2016-10-29 19:58:21 +00:00
|
|
|
|
ASM
|