mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-22 22:30:25 +00:00
Kernel 0.9.1 : SHELL : History & CL Editing OK
This commit is contained in:
parent
7a753cfbea
commit
98632f7a49
Binary file not shown.
Binary file not shown.
@ -60,6 +60,10 @@ CS.INIT ldy #S.PS.ARGC
|
||||
.1 >SYSCALL GetArg.A
|
||||
>STYA ZPPtr1
|
||||
|
||||
>SYSCALL PrintF.YA
|
||||
lda #'|'
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
lda (ZPPtr1)
|
||||
cmp #'-'
|
||||
bne .4
|
||||
|
@ -186,6 +186,8 @@ WRITE bit bEscMode
|
||||
.1 pha
|
||||
jsr CUROFF
|
||||
pla
|
||||
cmp #$7f
|
||||
beq DEL
|
||||
cmp #32
|
||||
bcc COUT.Ctrl
|
||||
|
||||
@ -202,6 +204,27 @@ FS ldx CH
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
DEL ldx CH
|
||||
beq .1
|
||||
dec CH
|
||||
bra .3
|
||||
|
||||
.1 ldy CV
|
||||
beq .8
|
||||
|
||||
lda #79
|
||||
sta CH
|
||||
dec CV
|
||||
|
||||
.3 lda #$20
|
||||
ora INVFLG
|
||||
ldx CH
|
||||
ldy CV
|
||||
jmp SetCharAtXY
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
COUT.Ctrl ldx #CtrlChars.Cnt-1
|
||||
|
||||
.1 cmp CtrlChars,x
|
||||
@ -383,13 +406,6 @@ BS ldx CH
|
||||
|
||||
.3 clc
|
||||
rts
|
||||
|
||||
|
||||
lda #$20
|
||||
ora INVFLG
|
||||
ldx CH
|
||||
ldy CV
|
||||
jmp SetCharAtXY
|
||||
*--------------------------------------
|
||||
ClrScr stz CH
|
||||
stz CV
|
||||
|
@ -79,7 +79,7 @@ Dev.Detect >STYA ARGS
|
||||
sta A2osX.SLOTS,y
|
||||
pla
|
||||
ora #$30
|
||||
sta DEV.HEADER.NAME+4
|
||||
sta DEV.HEADER.NAME+3
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
@ -97,7 +97,7 @@ DEVSIG.Offset .HS 05070B0C
|
||||
DEVSIG.Value .HS 38180131
|
||||
DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset
|
||||
MSG.DETECT >CSTR "Apple SSC (Super Serial Card,//c Serial Port) Driver.\r\n"
|
||||
MSG.DETECT.OK >CSTR "SSC Installed As Device : %S\r\n"
|
||||
MSG.DETECT.OK >CSTR "SSC Installed As Device : %s\r\n"
|
||||
MSG.DETECT.KO >CSTR "No SSC Found.\r\n"
|
||||
ARGS .BS 2
|
||||
*--------------------------------------
|
||||
@ -107,7 +107,7 @@ DEV.HEADER cld
|
||||
jmp (DRV.CS.START,x)
|
||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ
|
||||
.BS 6
|
||||
DEV.HEADER.NAME >PSTR "COM1" NAME
|
||||
DEV.HEADER.NAME >CSTR "COM1" NAME
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
|
@ -82,7 +82,7 @@ Dev.Detect >STYA ARGS
|
||||
sta A2osX.SLOTS,y
|
||||
pla
|
||||
ora #$30
|
||||
sta DEV.HEADER.NAME+4
|
||||
sta DEV.HEADER.NAME+3
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
@ -100,7 +100,7 @@ DEVSIG.Offset .HS 05070B0C
|
||||
DEVSIG.Value .HS 38180131
|
||||
DEVSIG.Length .EQ DEVSIG.Value-DEVSIG.Offset
|
||||
MSG.DETECT >CSTR "Apple SSC (Super Serial Card,//c Serial Port) Driver (IRQ Enabled).\r\n"
|
||||
MSG.DETECT.OK >CSTR "SSC Installed As Device : %S\r\n"
|
||||
MSG.DETECT.OK >CSTR "SSC Installed As Device : %s\r\n"
|
||||
MSG.DETECT.KO >CSTR "No SSC Found.\r\n"
|
||||
ARGS .BS 2
|
||||
*--------------------------------------
|
||||
@ -110,7 +110,7 @@ DEV.HEADER cld
|
||||
jmp (DRV.CS.START,x)
|
||||
.DA #S.DEV.S.WRITE+S.DEV.S.READ+S.DEV.S.IRQ
|
||||
.BS 6
|
||||
DEV.HEADER.NAME >PSTR "COM1" NAME
|
||||
DEV.HEADER.NAME >CSTR "COM1" NAME
|
||||
*--------------------------------------
|
||||
* Driver Code
|
||||
*--------------------------------------
|
||||
|
@ -164,8 +164,8 @@ note : '$VAR' does NOT expand Variable
|
||||
| Name | Status | Comment | K.Ver |
|
||||
| ---- | ------ | ------- | ----- |
|
||||
| Console.DRV | Working | ANSI support in Progress. | 0.9.1 |
|
||||
| SSC.DRV | Working | Apple "Super Serial Card" Driver | 0.9 |
|
||||
| SSC.I.DRV | Working | Apple "Super Serial Card" Driver (IRQ enabled) | 0.9 |
|
||||
| SSC.DRV | Working | Apple "Super Serial Card" Driver | 0.9.1 |
|
||||
| SSC.I.DRV | Working | Apple "Super Serial Card" Driver (IRQ enabled) | 0.9.1 |
|
||||
| PIC.DRV | In Progress | Apple "Parallel Interface Card" Driver, renamed from PPIC.DRV | 0.9 |
|
||||
| Mouse.DRV | Working | Apple Mouse Card,//c Mouse Port | 0.9 |
|
||||
| DHGR.DRV | In Progress | except bitblt... | 0.9 |
|
||||
@ -182,7 +182,7 @@ note : '$VAR' does NOT expand Variable
|
||||
| LSDEV | Working | | 0.9.1 |
|
||||
| PS | Working | | 0.9.1 |
|
||||
| MD | Working | | 0.9.1 |
|
||||
| LS | Working | -A : Do Not Print . & .. | 0.9 |
|
||||
| LS | Working | -A : Do Not Print . & .. | 0.9.1 |
|
||||
| | | -L : long listing with size/date... | |
|
||||
| | | -R : Recurse subdirectories | |
|
||||
| RM | Working | -C : Continue On Error | 0.9 |
|
||||
|
131
SBIN/SHELL.S.CL.txt
Normal file
131
SBIN/SHELL.S.CL.txt
Normal file
@ -0,0 +1,131 @@
|
||||
PR#3
|
||||
PREFIX /A2OSX.BUILD
|
||||
NEW
|
||||
INC 1
|
||||
AUTO 6
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
*--------------------------------------
|
||||
CmdLine.CLR ldy #0
|
||||
|
||||
.1 lda (ZPCMDBuf),y
|
||||
beq .9
|
||||
|
||||
.2 lda #$7F
|
||||
|
||||
sta (ZPCMDBuf),y
|
||||
iny
|
||||
lda (ZPCMDBuf),y
|
||||
bne .2
|
||||
|
||||
jsr CmdLine.PRINT
|
||||
|
||||
jmp CmdLine.RESET
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CmdLine.BS >LDA.G CmdBufPtr
|
||||
beq .9
|
||||
|
||||
dec
|
||||
sta (pData),y
|
||||
|
||||
lda #8
|
||||
>SYSCALL PutChar.A
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CmdLine.NAK >LDA.G CmdBufPtr
|
||||
>CMP.G CmdBuflen
|
||||
beq .9
|
||||
|
||||
inc
|
||||
>STA.G CmdBufPtr
|
||||
|
||||
lda #21
|
||||
>SYSCALL PutChar.A
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CmdLine.DEL >LDA.G CmdBuflen
|
||||
beq .8
|
||||
sec
|
||||
>SBC.G CmdBufPtr
|
||||
tax Keep in x char count to \0
|
||||
bne .1
|
||||
|
||||
>DEC.G CmdBuflen
|
||||
>STA.G CmdBufPtr
|
||||
|
||||
tay
|
||||
lda #0
|
||||
sta (ZPCMDBuf),y
|
||||
|
||||
lda #$7f
|
||||
>SYSCALL PutChar.A
|
||||
rts
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.1 >LDA.G CmdBufPtr
|
||||
tay
|
||||
|
||||
.2 iny
|
||||
lda (ZPCMDBuf),y
|
||||
dey
|
||||
sta (ZPCMDBuf),y
|
||||
iny
|
||||
dex
|
||||
bne .2
|
||||
|
||||
>DEC.G CmdBuflen
|
||||
*--------------------------------------
|
||||
CmdLine.PRINTPTR
|
||||
>LDA.G CmdBufPtr
|
||||
tay
|
||||
|
||||
.1 lda (ZPCMDBuf),y
|
||||
beq .2
|
||||
|
||||
phy
|
||||
>SYSCALL PutChar.A
|
||||
ply
|
||||
iny
|
||||
bra .1
|
||||
|
||||
.2 lda #' '
|
||||
>SYSCALL PutChar.A
|
||||
lda #8
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
>LDA.G CmdBufPtr
|
||||
tay
|
||||
|
||||
.3 lda (ZPCMDBuf),y
|
||||
beq .8
|
||||
|
||||
phy
|
||||
lda #8
|
||||
>SYSCALL PutChar.A
|
||||
ply
|
||||
iny
|
||||
bra .3
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CmdLine.PRINT >LDYA ZPCMDBuf
|
||||
>SYSCALL PrintF.YA
|
||||
rts
|
||||
*--------------------------------------
|
||||
CmdLine.RESET lda #0
|
||||
sta (ZPCMDBuf)
|
||||
>STA.G bCmdBufexec
|
||||
>STA.G CmdBufPtr
|
||||
>STA.G CmdBuflen
|
||||
>STA.G bSecureRead Clear password mode
|
||||
rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE /A2OSX.SRC/SBIN/SHELL.S.CL
|
||||
LOAD /A2OSX.SRC/SBIN/SHELL.S
|
||||
ASM
|
@ -205,12 +205,21 @@ Cmd.Exec.EXT.TXT
|
||||
>SYSCALL StrCpy
|
||||
|
||||
jsr Cmd.Exec.EXT.SEP Add a space....
|
||||
|
||||
|
||||
>LDA.G CMD.hFullpath
|
||||
>SYSCALL GetMemPtr.A
|
||||
>PUSHYA
|
||||
>PUSHW ZPCMDBuf
|
||||
>SYSCALL StrCat
|
||||
|
||||
>LDYA ZPCMDBuf
|
||||
>SYSCALL PrintF.YA
|
||||
lda #'!'
|
||||
>SYSCALL PutChar.A
|
||||
lda #13
|
||||
>SYSCALL PutChar.A
|
||||
lda #10
|
||||
>SYSCALL PutChar.A
|
||||
*--------------------------------------
|
||||
* BIN : Launch "/PATH/CMD ARGS"
|
||||
*--------------------------------------
|
||||
@ -224,6 +233,15 @@ Cmd.Exec.EXT.BIN
|
||||
>PUSHW ZPCMDBuf
|
||||
>SYSCALL StrCat
|
||||
|
||||
>LDYA ZPCMDBuf
|
||||
>SYSCALL PrintF.YA
|
||||
lda #'!'
|
||||
>SYSCALL PutChar.A
|
||||
lda #13
|
||||
>SYSCALL PutChar.A
|
||||
lda #10
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
.1 >LDA.G CMD.bStartProc
|
||||
asl
|
||||
>LDYA ZPCMDBuf
|
||||
|
@ -143,6 +143,10 @@ HIS.SetA jsr HIS.GetA
|
||||
sta (ZPCMDBuf),y
|
||||
bne .2
|
||||
|
||||
tya
|
||||
>STA.G CmdBufPtr
|
||||
>STA.G CmdBuflen
|
||||
|
||||
jmp CmdLine.PRINT
|
||||
*--------------------------------------
|
||||
HIS.GetA ldy #0
|
||||
|
126
SBIN/SHELL.S.txt
126
SBIN/SHELL.S.txt
@ -66,7 +66,6 @@ L.ENV.PWD .DA ENV.PWD
|
||||
L.ENV.PS1 .DA ENV.PS1
|
||||
L.FMT.DATE .DA FMT.DATE
|
||||
L.FMT.TIME .DA FMT.TIME
|
||||
L.MSG.HEXBYTE .DA MSG.HEXBYTE
|
||||
J.ESC .DA CmdLine.BS left arrow
|
||||
.DA HIS.GetNext
|
||||
.DA HIS.GetPrev
|
||||
@ -353,57 +352,45 @@ CS.CHARIN tax Save Char
|
||||
jmp CmdLine.DEL
|
||||
|
||||
.2 >LDA.G CmdBuflen
|
||||
|
||||
cmp #CmdLine.MAX
|
||||
beq .8 Buffer full, discard...
|
||||
|
||||
inc
|
||||
sta (pData),y
|
||||
|
||||
|
||||
clc Len-1-Ptr !!!!!
|
||||
>SBC.G CmdBufPtr
|
||||
beq .30
|
||||
phx
|
||||
tax
|
||||
>LDA.G CmdBuflen
|
||||
tay
|
||||
lda #0
|
||||
|
||||
.3 lda (ZPCMDBuf),y Move from Ptr To end of buffer forward...
|
||||
iny
|
||||
sta (ZPCMDBuf),y
|
||||
|
||||
>LDA.G CmdBufPtr
|
||||
tay
|
||||
|
||||
*.3 lda (ZPCMDBuf),y Move from Ptr To end of buffer forward...
|
||||
* iny
|
||||
* sta (ZPCMDBuf),y
|
||||
* ora #0
|
||||
* bne .3 ...until ending 0
|
||||
|
||||
|
||||
>LDA.G CmdBufPtr Insert char at Ptr
|
||||
dey
|
||||
dey
|
||||
dex
|
||||
bne .3
|
||||
plx
|
||||
|
||||
.30 >LDA.G CmdBufPtr Insert char at Ptr
|
||||
tay
|
||||
txa
|
||||
sta (ZPCMDBuf),y
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
>INC.G CmdBufPtr
|
||||
>CMP.G CmdBuflen
|
||||
bne .4
|
||||
beq .8
|
||||
|
||||
jmp CmdLine.PRINTPTR
|
||||
|
||||
|
||||
|
||||
|
||||
.4 >LDA.G bSecureRead
|
||||
bne .8
|
||||
|
||||
txa
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.CHARIN.CTRL
|
||||
* phx
|
||||
* txa
|
||||
* >PUSHA
|
||||
* >LDYA L.MSG.HEXBYTE
|
||||
* >SYSCALL PrintF.YA
|
||||
* plx
|
||||
|
||||
cpx #13 CR
|
||||
bne .10
|
||||
|
||||
@ -412,6 +399,13 @@ CS.CHARIN.CTRL
|
||||
lda #10
|
||||
>SYSCALL PutChar.A
|
||||
|
||||
>LDA.G CmdBufPtr
|
||||
tay
|
||||
lda #0
|
||||
sta (ZPCMDBuf),y
|
||||
tya
|
||||
>STA.G CmdBuflen
|
||||
|
||||
lda #$ff
|
||||
>STA.G bCmdBufexec
|
||||
clc
|
||||
@ -475,70 +469,7 @@ PrintPrompt >LDYA L.ENV.PS1
|
||||
plp
|
||||
rts
|
||||
*--------------------------------------
|
||||
CmdLine.CLR ldy #0
|
||||
|
||||
.1 lda (ZPCMDBuf),y
|
||||
beq .9
|
||||
|
||||
.2 lda #8
|
||||
|
||||
sta (ZPCMDBuf),y
|
||||
iny
|
||||
lda (ZPCMDBuf),y
|
||||
bne .2
|
||||
|
||||
jsr CmdLine.PRINT
|
||||
|
||||
jmp CmdLine.RESET
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CmdLine.BS >LDA.G CmdBufPtr
|
||||
beq .9
|
||||
|
||||
dec
|
||||
sta (pData),y
|
||||
|
||||
lda #8
|
||||
>SYSCALL PutChar.A
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CmdLine.NAK >LDA.G CmdBufPtr
|
||||
>CMP.G CmdBuflen
|
||||
beq .9
|
||||
|
||||
inc
|
||||
>STA.G CmdBufPtr
|
||||
|
||||
lda #21
|
||||
>SYSCALL PutChar.A
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CmdLine.DEL >LDA.G CmdBuflen
|
||||
beq .9
|
||||
dec
|
||||
sta (pData),y
|
||||
|
||||
tay
|
||||
lda #0
|
||||
sta (ZPCMDBuf),y
|
||||
|
||||
lda #8
|
||||
>SYSCALL PutChar.A
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CmdLine.PRINT >LDYA ZPCMDBuf
|
||||
>SYSCALL PrintF.YA
|
||||
rts
|
||||
*--------------------------------------
|
||||
CmdLine.RESET lda #0
|
||||
sta (ZPCMDBuf)
|
||||
>STA.G bCmdBufexec
|
||||
>STA.G CmdBufPtr
|
||||
>STA.G CmdBuflen
|
||||
>STA.G bSecureRead Clear password mode
|
||||
rts
|
||||
*--------------------------------------
|
||||
.INB /A2OSX.SRC/SBIN/SHELL.S.CL
|
||||
.INB /A2OSX.SRC/SBIN/SHELL.S.CMD
|
||||
.INB /A2OSX.SRC/SBIN/SHELL.S.CSH
|
||||
.INB /A2OSX.SRC/SBIN/SHELL.S.IO
|
||||
@ -580,7 +511,6 @@ MSG.PRINTENV >CSTR "%s=%s\r\n"
|
||||
MSG.CSHERR >CSTR "Pos %D:"
|
||||
FMT.DATE >CSTR "%A, %B %d %Y"
|
||||
FMT.TIME >CSTR "%H:%M:%S (%I:%M:%S%p)"
|
||||
MSG.HEXBYTE >CSTR "[%h]"
|
||||
*--------------------------------------
|
||||
.INB /A2OSX.SRC/X.ERRORS.S
|
||||
*--------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user