mirror of
https://github.com/A2osX/A2osX.git
synced 2025-04-08 01:37:13 +00:00
Kernel 0.92+
This commit is contained in:
parent
e9bfd87013
commit
81f27254d3
Binary file not shown.
@ -20,6 +20,8 @@ AUTO 4,1 Enable MASM3 auto line num
|
||||
ZS.START
|
||||
ZPPtr1 .BS 2
|
||||
ZPPtr2 .BS 2
|
||||
ZPPtr3 .BS 2
|
||||
ZPFileBuf .BS 2
|
||||
ZPFileBufPtr .BS 2
|
||||
|
||||
ZPCSHSymbols .BS 2
|
||||
@ -48,7 +50,9 @@ CS.START cld
|
||||
.DA CS.RUN
|
||||
.DA CS.DOEVENT
|
||||
.DA CS.QUIT
|
||||
L.MSG.GREETINGS .DA MSG.GREETINGS
|
||||
L.MSG.GREETINGS .DA MSG.GREETINGS
|
||||
L.MSG.ECHOCRLF .DA MSG.ECHOCRLF
|
||||
L.MSG.ERR .DA MSG.ERR
|
||||
.INB USR/SRC/BIN/CSH.R
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
@ -85,12 +89,23 @@ CS.RUN >PUSHWI K.VER
|
||||
txa
|
||||
>STA.G hFileBuf
|
||||
>SYSCALL GetMemPtr
|
||||
>STYA ZPFileBuf
|
||||
>STYA ZPFileBufPtr
|
||||
|
||||
.1 >SLEEP
|
||||
jsr CSH.Run
|
||||
bcc .1
|
||||
|
||||
cmp #MLI.E.EOF
|
||||
beq .8
|
||||
pha
|
||||
jsr PrintErrMsg
|
||||
pla
|
||||
sec
|
||||
rts
|
||||
|
||||
.8 lda #0
|
||||
sec
|
||||
rts
|
||||
|
||||
.90 lda #E.SYN Exit Code = Succes
|
||||
@ -110,6 +125,80 @@ CS.QUIT jsr CSH.Quit
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
PrintErrMsg >LDYA ZPFileBuf
|
||||
>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 #C.CR
|
||||
bne .2 Scan until EoL
|
||||
|
||||
ldx ZPPtr1
|
||||
cpx ZPFileBufPtr
|
||||
lda ZPPtr1+1
|
||||
sbc ZPFileBufPtr+1
|
||||
bcc .1 not this line....
|
||||
|
||||
.4 ldy #0
|
||||
|
||||
.5 lda (ZPPtr2),y
|
||||
beq .6
|
||||
iny
|
||||
cmp #C.CR
|
||||
beq .6
|
||||
phy
|
||||
>PUSHA
|
||||
ldy #S.PS.hStdErr
|
||||
lda (pPS),y
|
||||
>SYSCALL fputc
|
||||
ply
|
||||
bra .5
|
||||
|
||||
.6 >PUSHBI 0
|
||||
>PUSHW L.MSG.ECHOCRLF
|
||||
ldy #S.PS.hStdErr
|
||||
lda (pPS),y
|
||||
>SYSCALL fprintf
|
||||
|
||||
lda ZPFileBufPtr
|
||||
sec
|
||||
sbc ZPPtr2
|
||||
beq .8
|
||||
tay
|
||||
|
||||
.7 phy
|
||||
>PUSHBI '-'
|
||||
ldy #S.PS.hStdErr
|
||||
lda (pPS),y
|
||||
>SYSCALL fputc
|
||||
ply
|
||||
dey
|
||||
bne .7
|
||||
|
||||
.8 >PUSHW ZPPtr3
|
||||
|
||||
>PUSHBI 2
|
||||
>PUSHW L.MSG.ERR
|
||||
ldy #S.PS.hStdErr
|
||||
lda (pPS),y
|
||||
>SYSCALL fprintf
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
.INB USR/SRC/BIN/CSH.S.CORE
|
||||
*--------------------------------------
|
||||
CS.END
|
||||
@ -117,6 +206,8 @@ CS.END
|
||||
* Initialized DATA
|
||||
*--------------------------------------
|
||||
MSG.Greetings .AZ "\r\nCSH-Shell %d.%d\r\n\r\n"
|
||||
MSG.ECHOCRLF .AZ "\r\n"
|
||||
MSG.ERR .AZ "^\r\nLine #%D:"
|
||||
.INB USR/SRC/BIN/CSH.I
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
|
Loading…
x
Reference in New Issue
Block a user