A2osX/BIN/SH.S.HIS.txt

187 lines
2.6 KiB
Plaintext
Raw Normal View History

NEW
2019-06-02 08:58:46 +00:00
AUTO 3,1
2015-10-19 20:35:00 +00:00
*--------------------------------------
HIS.Init >LDYAI HISBUF.MAX Get a buffer for History
2021-04-29 11:56:34 +00:00
>SYSCALL StrVNew
2015-10-19 20:35:00 +00:00
bcs .9
>STA.G HIS.hBuf
2020-02-02 18:24:40 +00:00
2021-05-14 20:58:20 +00:00
* >STZ.G HIS.Count
* >STZ.G HIS.Head
* clc
2015-10-19 20:35:00 +00:00
.9 rts
*--------------------------------------
HIS.Add >LDA.G HIS.hBuf
2015-10-19 20:35:00 +00:00
beq .9
2021-04-29 11:56:34 +00:00
>LDA.G HIS.Count
cmp #HISCNT.MAX
bcs .1
2021-04-29 11:56:34 +00:00
inc
sta (pData),y
2021-04-29 11:56:34 +00:00
>STA.G HIS.Head
bra .2
2021-04-29 11:56:34 +00:00
.1 ldy #HIS.Head
jsr HIS.NextY replace oldest
sta (pData),y
.2 tax
2021-04-29 11:56:34 +00:00
>PUSHB.G HIS.hBuf
2021-04-29 11:56:34 +00:00
>PUSHBI 0
txa
2020-02-02 14:58:01 +00:00
>PUSHA
>PUSHW ZPCLBuf
2021-04-29 11:56:34 +00:00
>SYSCALL StrVSet
.9 rts
*--------------------------------------
HIS.Select >LDA.G HIS.Count
2021-05-09 17:04:44 +00:00
bne .10
2021-05-09 17:04:44 +00:00
clc
.99 rts
2021-05-14 20:58:20 +00:00
.10 jsr CL.Reset
ldx #0
2021-04-29 11:56:34 +00:00
.1 inx
phx
jsr HIS.GetX
plx
2021-05-09 17:04:44 +00:00
bcs .99
2021-04-29 11:56:34 +00:00
2021-05-09 17:04:44 +00:00
>PUSHW L.MSG.HIS
txa
2021-05-14 20:58:20 +00:00
dec
>PUSHA
2021-04-29 11:56:34 +00:00
>PUSHW ZPCLBuf
>PUSHBI 3
phx
2021-04-29 11:56:34 +00:00
>SYSCALL PrintF
plx
2021-04-29 11:56:34 +00:00
bcs .9
txa
2021-04-29 11:56:34 +00:00
>CMP.G HIS.Count
bne .1
2021-05-09 17:04:44 +00:00
>LDYA L.MSG.HISPROMPT
2023-05-16 16:53:52 +00:00
jsr IO.OutYA
bcs .9
2021-05-09 17:04:44 +00:00
2021-05-15 14:35:24 +00:00
lda #0
sta (ZPCLBuf)
ldy #HIS.Ptr
sta (ZPCLBuf),y
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
>SYSCALL GetChar
bcs .9
2021-05-09 17:04:44 +00:00
cmp #'0'
bcc .7
cmp #'9'+1
bcs .7
and #$f
2021-05-14 20:58:20 +00:00
inc
>STA.G HIS.Ptr
2021-05-14 20:58:20 +00:00
.7 >LDYA L.MSG.HISROMPTCLR
2023-05-16 16:53:52 +00:00
jsr IO.OutYA
bcs .9
2021-04-29 11:56:34 +00:00
jsr CL.PrintPrompt
2021-05-14 20:58:20 +00:00
bcc HIS.GetToCL1
2021-05-09 17:04:44 +00:00
.9
2021-04-29 11:56:34 +00:00
HIS.Select.RTS rts
2015-10-19 20:35:00 +00:00
*--------------------------------------
2021-05-14 20:58:20 +00:00
HIS.GetPrev >LDA.G HIS.Count
2021-04-29 11:56:34 +00:00
beq HIS.Select.RTS empty history,nothing to do
2020-02-02 14:58:01 +00:00
>LDA.G HIS.Ptr
bne .1
2020-02-02 14:58:01 +00:00
>LDA.G HIS.Head Get newest
2021-05-14 20:58:20 +00:00
bra HIS.GetToCL
2021-04-29 11:56:34 +00:00
.1 dec
bne .2
>LDA.G HIS.Count
.2 bra HIS.GetToCL
2015-10-19 20:35:00 +00:00
*--------------------------------------
2021-05-14 20:58:20 +00:00
HIS.GetNext >LDA.G HIS.Count
2021-04-29 11:56:34 +00:00
beq HIS.Select.RTS empty history,nothing to do
2020-02-02 14:58:01 +00:00
>LDA.G HIS.Ptr
bne .1
2021-05-14 20:58:20 +00:00
ldy #HIS.Head
.1 jsr HIS.NextY
*--------------------------------------
HIS.GetToCL >STA.G HIS.Ptr
jsr CL.CLR.1
2021-05-14 20:58:20 +00:00
HIS.GetToCL1 >LDA.G HIS.Ptr
2021-05-14 20:58:20 +00:00
beq .9
2020-02-02 14:58:01 +00:00
tax
jsr HIS.GetX
2021-04-29 11:56:34 +00:00
bcs .9
2020-02-02 14:58:01 +00:00
2020-02-02 15:56:46 +00:00
ldy #$ff
2021-04-29 11:56:34 +00:00
2020-02-02 15:56:46 +00:00
.1 iny
lda (ZPCLBuf),y
bne .1
2021-04-29 11:56:34 +00:00
2020-02-02 15:56:46 +00:00
tya
2021-04-29 11:56:34 +00:00
2020-02-02 15:56:46 +00:00
>STA.G CL.Ptr
2018-11-10 14:30:09 +00:00
>STA.G CL.Len
>LDYA ZPCLBuf
2023-05-16 16:53:52 +00:00
jmp IO.OutYA
2021-04-29 11:56:34 +00:00
.9 rts
*--------------------------------------
HIS.GetX >PUSHB.G HIS.hBuf
2021-04-29 11:56:34 +00:00
>PUSHBI 0
txa
>PUSHA
2021-04-29 11:56:34 +00:00
>PUSHW ZPCLBuf
>SYSCALL StrVGet
rts
2015-10-19 20:35:00 +00:00
*--------------------------------------
HIS.NextY lda (pData),y
phy
>CMP.G HIS.Count
ply
bcc .1
lda #0
.1 inc
rts
*--------------------------------------
2015-10-19 20:35:00 +00:00
MAN
2020-05-26 14:23:09 +00:00
SAVE usr/src/bin/sh.s.his
LOAD usr/src/bin/sh.s
2015-10-19 20:35:00 +00:00
ASM