2018-01-18 06:49:41 +00:00
|
|
|
|
NEW
|
2019-06-02 08:58:46 +00:00
|
|
|
|
AUTO 3,1
|
2015-10-19 20:35:00 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +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
|
|
|
|
|
|
2017-09-08 14:49:23 +00:00
|
|
|
|
>STA.G HIS.hBuf
|
2020-02-02 18:24:40 +00:00
|
|
|
|
|
2021-05-14 20:58:20 +00:00
|
|
|
|
* >STZ.G HIS.Count
|
2022-10-07 19:21:37 +00:00
|
|
|
|
* >STZ.G HIS.Head
|
|
|
|
|
* clc
|
|
|
|
|
|
2015-10-19 20:35:00 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-09-08 14:49:23 +00:00
|
|
|
|
HIS.Add >LDA.G HIS.hBuf
|
2015-10-19 20:35:00 +00:00
|
|
|
|
beq .9
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>LDA.G HIS.Count
|
2022-10-07 19:21:37 +00:00
|
|
|
|
cmp #HISCNT.MAX
|
|
|
|
|
bcs .1
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
>STA.G HIS.Head
|
2022-10-08 12:37:10 +00:00
|
|
|
|
bra .2
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.1 ldy #HIS.Head
|
|
|
|
|
jsr HIS.NextY replace oldest
|
2022-10-08 12:37:10 +00:00
|
|
|
|
sta (pData),y
|
2022-10-07 19:21:37 +00:00
|
|
|
|
|
2022-10-08 12:37:10 +00:00
|
|
|
|
.2 tax
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
2022-10-08 12:37:10 +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
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2021-05-09 17:04:44 +00:00
|
|
|
|
clc
|
|
|
|
|
.99 rts
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2021-05-14 20:58:20 +00:00
|
|
|
|
.10 jsr CL.Reset
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
ldx #0
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +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
|
2022-10-07 19:21:37 +00:00
|
|
|
|
txa
|
2021-05-14 20:58:20 +00:00
|
|
|
|
dec
|
|
|
|
|
>PUSHA
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>PUSHW ZPCLBuf
|
|
|
|
|
>PUSHBI 3
|
2022-10-07 19:21:37 +00:00
|
|
|
|
phx
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>SYSCALL PrintF
|
2022-10-07 19:21:37 +00:00
|
|
|
|
plx
|
2021-04-29 11:56:34 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
txa
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>CMP.G HIS.Count
|
|
|
|
|
bne .1
|
2021-05-09 17:04:44 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
>LDYA L.MSG.HISPROMPT
|
2023-05-16 16:53:52 +00:00
|
|
|
|
jsr IO.OutYA
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcs .9
|
2021-05-09 17:04:44 +00:00
|
|
|
|
|
2021-05-15 14:35:24 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPCLBuf)
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
ldy #HIS.Ptr
|
|
|
|
|
sta (ZPCLBuf),y
|
2021-05-15 14:35:24 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>SYSCALL GetChar
|
2022-10-07 19:21:37 +00:00
|
|
|
|
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
|
2022-10-07 19:21:37 +00:00
|
|
|
|
>STA.G HIS.Ptr
|
2021-05-14 20:58:20 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.7 >LDYA L.MSG.HISROMPTCLR
|
2023-05-16 16:53:52 +00:00
|
|
|
|
jsr IO.OutYA
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcs .9
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
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
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
>LDA.G HIS.Ptr
|
2017-09-25 15:50:33 +00:00
|
|
|
|
bne .1
|
2020-02-02 14:58:01 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +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
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
.1 dec
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
>LDA.G HIS.Count
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.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
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
>LDA.G HIS.Ptr
|
|
|
|
|
bne .1
|
2021-05-14 20:58:20 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
ldy #HIS.Head
|
|
|
|
|
|
|
|
|
|
.1 jsr HIS.NextY
|
2017-09-26 15:55:25 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
HIS.GetToCL >STA.G HIS.Ptr
|
2017-09-26 15:55:25 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr CL.CLR.1
|
2021-05-14 20:58:20 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +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
|
|
|
|
|
2022-10-07 19:21:37 +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
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
>LDYA ZPCLBuf
|
2023-05-16 16:53:52 +00:00
|
|
|
|
jmp IO.OutYA
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
HIS.GetX >PUSHB.G HIS.hBuf
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>PUSHBI 0
|
2022-10-07 19:21:37 +00:00
|
|
|
|
txa
|
|
|
|
|
>PUSHA
|
2021-04-29 11:56:34 +00:00
|
|
|
|
>PUSHW ZPCLBuf
|
|
|
|
|
>SYSCALL StrVGet
|
|
|
|
|
rts
|
2015-10-19 20:35:00 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
HIS.NextY lda (pData),y
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
phy
|
|
|
|
|
>CMP.G HIS.Count
|
|
|
|
|
ply
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
bcc .1
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
lda #0
|
2022-10-09 21:22:46 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.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
|