A2osX/SBIN/SHELL.S.CL.txt

148 lines
2.4 KiB
Plaintext
Raw Normal View History

PR#3
PREFIX /A2OSX.BUILD
NEW
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
*--------------------------------------
PrintPrompt >LDYA L.ENV.PS1
>SYSCALL GetEnv.YA
>SYSCALL ExpandStr.YA
phx
>SYSCALL PrintF.YA
>LDYA L.MSG.PROMPT
>SYSCALL PrintF.YA
plx
php
pha
txa
>SYSCALL FreeMem.A
pla
plp
rts
*--------------------------------------
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