mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-20 15:29:07 +00:00
SH:History fix
MORE:combined options CC:"All done" message if success
This commit is contained in:
parent
f61b181886
commit
947764b71e
Binary file not shown.
11
BIN/CC.S.txt
11
BIN/CC.S.txt
@ -132,6 +132,7 @@ L.MSG.RTSTK .DA MSG.RTSTK
|
||||
L.MSG.ERROR .DA MSG.ERROR
|
||||
L.MSG.SUMMARY .DA MSG.SUMMARY
|
||||
L.MSG.NOMAIN .DA MSG.NOMAIN
|
||||
L.MSG.ALLDONE .DA MSG.ALLDONE
|
||||
L.ENV.INCLUDE .DA ENV.INCLUDE
|
||||
L.ENV.LIB .DA ENV.LIB
|
||||
L.LIB.O .DA LIB.O
|
||||
@ -353,7 +354,7 @@ CS.RUN.CLOOP jsr CORE.CompileFile
|
||||
|
||||
jsr CC.Link
|
||||
bcs .99
|
||||
>DEBUG
|
||||
* >DEBUG
|
||||
jsr CC.Link.CheckMain
|
||||
bcs .99
|
||||
|
||||
@ -379,7 +380,10 @@ CS.RUN.CLOOP jsr CORE.CompileFile
|
||||
jsr FIO.FClose
|
||||
bne .2
|
||||
*--------------------------------------
|
||||
.8 lda #0 Exit Code = Success
|
||||
>LDYA L.MSG.ALLDONE
|
||||
>SYSCALL PutS
|
||||
|
||||
lda #0 Exit Code = Success
|
||||
sec
|
||||
rts
|
||||
|
||||
@ -643,8 +647,9 @@ MSG.DEBUG .CS "*** pCode=%H, pConst=%H, pData=%H, pStack=%H\r\n"
|
||||
MSG.TRACE .CZ "%5D> %s\r\n"
|
||||
MSG.RTSTK .CZ "<pBase=%H, pVar=%H, (pVar)=%H, pStack=%H>\r\n"
|
||||
MSG.ERROR .CZ " %s^\r\n"
|
||||
MSG.SUMMARY .CZ "*** Compilation OK : Code size=%5D, Const size=%5D, uData size=%5D\r\n"
|
||||
MSG.SUMMARY .CZ "*** Compilation OK : Code size=%5D, Const size=%5D, Data size=%5D\r\n"
|
||||
MSG.NOMAIN .CZ "*** No 'main()' function defined."
|
||||
MSG.ALLDONE .CZ "*** All Done."
|
||||
*--------------------------------------
|
||||
OptionList .AS "DdTtLl"
|
||||
OptionVars .DA #bDebug,#bDebug,#bTrace,#bTrace
|
||||
|
@ -7,17 +7,13 @@ NEW
|
||||
*/-------------------------------------
|
||||
* # MKDIR
|
||||
* Create directories
|
||||
*
|
||||
* ## Arguments
|
||||
* **-M mode**
|
||||
* Apply specified mode to created directories
|
||||
*
|
||||
* **-P**
|
||||
* Create parent directories if required
|
||||
*
|
||||
* **-V**
|
||||
* Verbose mode
|
||||
*
|
||||
* ## Return Value
|
||||
*\-------------------------------------
|
||||
.INB inc/macros.i
|
||||
|
@ -4,7 +4,19 @@ NEW
|
||||
.OP 65C02
|
||||
.OR $2000
|
||||
.TF bin/more
|
||||
*--------------------------------------
|
||||
*/-------------------------------------
|
||||
* # MORE
|
||||
* Displays content of specified file
|
||||
* Input pipe allowed
|
||||
* ## Arguments
|
||||
* **-H**
|
||||
* Displays help screen
|
||||
* **-N**
|
||||
* Number all output lines
|
||||
* **-P**
|
||||
* Page mode, no scroll
|
||||
* ## Return Value
|
||||
*\-------------------------------------
|
||||
.INB inc/macros.i
|
||||
.INB inc/a2osx.i
|
||||
.INB inc/kernel.i
|
||||
@ -25,7 +37,6 @@ LineNum .BS 2
|
||||
bHelp .BS 1
|
||||
bLineNum .BS 1
|
||||
bPage .BS 1
|
||||
bEscCodes .BS 1
|
||||
ArgIndex .BS 1
|
||||
hBuf .BS 1
|
||||
ZS.END .ED
|
||||
@ -53,16 +64,11 @@ CS.START cld
|
||||
L.MSG.USAGE .DA MSG.USAGE
|
||||
L.MSG.Init .DA MSG.Init
|
||||
L.MSG.NUMLINE .DA MSG.NUMLINE
|
||||
L.MSG.CRLF .DA MSG.CRLF
|
||||
L.MSG.Pause .DA MSG.Pause
|
||||
L.MSG.PauseErase .DA MSG.PauseErase
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
CS.INIT clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.RUN
|
||||
.1 inc ArgCount
|
||||
CS.RUN inc ArgCount
|
||||
lda ArgCount
|
||||
>SYSCALL ArgV
|
||||
bcs .7
|
||||
@ -74,8 +80,9 @@ CS.RUN
|
||||
|
||||
ldy #1
|
||||
lda (ZPPtr1),y
|
||||
beq .99
|
||||
|
||||
ldx #OptionVars-OptionList-1
|
||||
.1 ldx #OptionVars-OptionList-1
|
||||
|
||||
.2 cmp OptionList,x
|
||||
beq .3
|
||||
@ -83,17 +90,22 @@ CS.RUN
|
||||
dex
|
||||
bpl .2
|
||||
|
||||
.99 >PUSHW L.MSG.USAGE
|
||||
>PUSHBI 0
|
||||
>SYSCALL PrintF
|
||||
.99 >LDYA L.MSG.USAGE
|
||||
>SYSCALL PutS
|
||||
lda #E.SYN
|
||||
sec
|
||||
.9 rts
|
||||
|
||||
.3 ldy OptionVars,x
|
||||
lda #$80
|
||||
sta (pData),y
|
||||
bra .1
|
||||
.3 lda OptionVars,x
|
||||
tax
|
||||
sec
|
||||
ror $0,x
|
||||
|
||||
iny
|
||||
lda (ZPPtr1),y
|
||||
bne .1
|
||||
|
||||
bra CS.RUN
|
||||
|
||||
.4 lda hFile
|
||||
bne .99
|
||||
@ -102,7 +114,7 @@ CS.RUN
|
||||
jsr CS.RUN.OPEN
|
||||
bcs .9
|
||||
|
||||
bra .1 scan for any other args
|
||||
bra CS.RUN scan for any other args
|
||||
|
||||
.7 lda bHelp
|
||||
beq .8
|
||||
@ -136,7 +148,7 @@ CS.RUN
|
||||
>PUSHW L.MSG.Init
|
||||
>PUSHBI 0
|
||||
>SYSCALL PrintF
|
||||
|
||||
*--------------------------------------
|
||||
CS.RUN.LOOP jsr CS.RUN.GETLINE
|
||||
bcs .9
|
||||
|
||||
@ -180,6 +192,7 @@ CS.RUN.OPEN >PUSHYA
|
||||
|
||||
>SYSCALL FOpen
|
||||
bcs .9
|
||||
|
||||
sta hFile
|
||||
|
||||
.9 rts
|
||||
@ -188,8 +201,7 @@ CS.RUN.PAUSE ldy #S.PS.hStdErr
|
||||
lda (pPS),y
|
||||
>PUSHA
|
||||
>PUSHW L.MSG.Pause
|
||||
>PUSHBI 0
|
||||
>SYSCALL FPrintF
|
||||
>SYSCALL FPutS
|
||||
|
||||
.10 jsr CS.RUN.GETC
|
||||
bcs .99
|
||||
@ -217,6 +229,7 @@ CS.RUN.PAUSE ldy #S.PS.hStdErr
|
||||
beq .90
|
||||
|
||||
rts
|
||||
|
||||
.5 inc LineNum
|
||||
bne .6
|
||||
|
||||
@ -235,8 +248,7 @@ CS.RUN.ERASE ldy #S.PS.hStdErr
|
||||
lda (pPS),y
|
||||
>PUSHA
|
||||
>PUSHW L.MSG.PauseErase
|
||||
>PUSHBI 0
|
||||
>SYSCALL FPrintF
|
||||
>SYSCALL FPutS
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.RUN.GETC lda hFile
|
||||
@ -272,21 +284,9 @@ CS.RUN.PRINT lda bLineNum
|
||||
>SYSCALL PrintF
|
||||
bcs .9
|
||||
|
||||
.1 lda bEscCodes
|
||||
bmi .2
|
||||
|
||||
>LDYA ZPBufPtr
|
||||
.1 >LDYA ZPBufPtr
|
||||
>SYSCALL PutS
|
||||
rts
|
||||
|
||||
.2 >PUSHW ZPBufPtr
|
||||
>PUSHBI 0
|
||||
>SYSCALL PrintF
|
||||
bcs .9
|
||||
|
||||
>PUSHW L.MSG.CRLF
|
||||
>PUSHBI 0
|
||||
>SYSCALL PrintF
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CS.QUIT lda hBuf
|
||||
@ -299,7 +299,8 @@ CS.QUIT lda hBuf
|
||||
|
||||
>SYSCALL FClose
|
||||
.2
|
||||
.8 clc
|
||||
.8
|
||||
CS.INIT clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.DOEVENT sec
|
||||
@ -307,15 +308,13 @@ CS.DOEVENT sec
|
||||
*--------------------------------------
|
||||
CS.END
|
||||
*--------------------------------------
|
||||
OptionList .AS "NnHhPpSs"
|
||||
OptionVars .DA #bLineNum,#bLineNum,#bHelp,#bHelp,#bPage,#bPage,#bEscCodes,#bEscCodes
|
||||
OptionList .AS "NnHhPp"
|
||||
OptionVars .DA #bLineNum,#bLineNum,#bHelp,#bHelp,#bPage,#bPage
|
||||
*--------------------------------------
|
||||
MSG.USAGE .CS "Usage : MORE <File>\r\n"
|
||||
.CS " -H : This help screen\r\n"
|
||||
.CS " -N : Number all output lines\r\n"
|
||||
.CS " -P : Page mode, no scroll\r\n"
|
||||
.CS " -S : Process ESC codes"
|
||||
MSG.CRLF .CZ "\r\n"
|
||||
.CZ " -P : Page mode, no scroll\r\n"
|
||||
MSG.Init .CZ "\e[?7l"
|
||||
MSG.NUMLINE .CZ "%5D:"
|
||||
MSG.Pause .CZ "\r\e[7m --- 'SPACE' for more, 'CR' one line, 'Q/q' to quit --- \e[0m"
|
||||
|
@ -378,11 +378,7 @@ CORE.ExecCmd lda #0
|
||||
tax
|
||||
jmp (J.CMD,x)
|
||||
*--------------------------------------
|
||||
CORE.ExecExtCmd ldy #S.PS.RC
|
||||
lda #0
|
||||
sta (pPS),y
|
||||
|
||||
>PUSHW ZPArgVBuf
|
||||
CORE.ExecExtCmd >PUSHW ZPArgVBuf
|
||||
>PUSHB CORE.PSFlags
|
||||
|
||||
>SYSCALL ExecV
|
||||
@ -698,22 +694,16 @@ CORE.GetNextChar
|
||||
|
||||
inc ZPInputBufPtr+1
|
||||
*--------------------------------------
|
||||
CORE.GetChar phy
|
||||
|
||||
.1 lda (ZPInputBufPtr)
|
||||
CORE.GetChar clc
|
||||
lda (ZPInputBufPtr)
|
||||
bne .8
|
||||
|
||||
>LDA.G CODE.STACK
|
||||
cmp #CODE.STACK
|
||||
beq .9
|
||||
|
||||
jsr CORE.PopBuf
|
||||
bra .1
|
||||
bcc CORE.GetChar
|
||||
|
||||
.8 clc
|
||||
lda #0
|
||||
|
||||
.9 ply
|
||||
rts
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
CORE.SkipCharsA clc
|
||||
adc ZPInputBufPtr
|
||||
@ -761,7 +751,9 @@ CORE.PushBufX >LDA.G CODE.STACK
|
||||
* sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
CORE.PopBuf >LDA.G CODE.STACK
|
||||
CORE.PopBuf phy
|
||||
|
||||
>LDA.G CODE.STACK
|
||||
cmp #CODE.STACK
|
||||
beq .9
|
||||
|
||||
@ -783,10 +775,14 @@ CORE.PopBuf >LDA.G CODE.STACK
|
||||
tya
|
||||
>STA.G CODE.STACK
|
||||
|
||||
ply
|
||||
|
||||
* clc
|
||||
rts
|
||||
|
||||
.9 lda #E.STACKERROR
|
||||
.9 ply
|
||||
|
||||
lda #E.STACKERROR
|
||||
* sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
|
@ -26,15 +26,15 @@ HIS.Add >LDA.G HIS.hBuf
|
||||
sta (pData),y
|
||||
|
||||
>STA.G HIS.Head
|
||||
tax
|
||||
bra .7
|
||||
bra .2
|
||||
|
||||
.1 ldy #HIS.Head
|
||||
jsr HIS.NextY replace oldest
|
||||
sta (pData),y
|
||||
|
||||
tax
|
||||
.2 tax
|
||||
|
||||
.7 >PUSHB.G HIS.hBuf
|
||||
>PUSHB.G HIS.hBuf
|
||||
>PUSHBI 0
|
||||
txa
|
||||
>PUSHA
|
||||
|
Loading…
x
Reference in New Issue
Block a user