2020-02-07 15:35:52 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
*--------------------------------------
|
2021-04-29 11:56:34 +00:00
|
|
|
|
STRVX.StrVNew jsr K.GetMem
|
|
|
|
|
bcs .9
|
2020-03-10 16:42:07 +00:00
|
|
|
|
|
2020-02-07 15:35:52 +00:00
|
|
|
|
>STYA ZPPtr1 strV
|
2021-04-29 11:56:34 +00:00
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPPtr1)
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
STRVX.StrVSet jsr STRVX.GetID
|
|
|
|
|
bcs .7
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
ldy #$ff
|
|
|
|
|
|
|
|
|
|
.1 iny
|
|
|
|
|
jsr SHARED.FORPNT.GetY
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
tya
|
|
|
|
|
|
|
|
|
|
* clc
|
|
|
|
|
adc #4 LEN+IDlo+IDhi+\0
|
|
|
|
|
bcs .99
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
cmp (ZPPtr1)
|
|
|
|
|
bne .4
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
lda ZPPtr1 Same Length, replace
|
|
|
|
|
clc
|
|
|
|
|
adc #3
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bcc .2
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
inc ZPPtr1+1
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.2 ldy #$ff
|
|
|
|
|
|
|
|
|
|
.3 iny
|
|
|
|
|
jsr SHARED.FORPNT.GetY
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
bne .3
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.4 >LDYA ZPPtr1
|
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
|
|
|
|
|
jsr STRVX.Next
|
2020-03-10 16:42:07 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.40 lda (ZPPtr1)
|
|
|
|
|
beq .7
|
|
|
|
|
|
|
|
|
|
ldy #2 LEN+IDlo+IDhi
|
|
|
|
|
|
|
|
|
|
.5 lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .5
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
ldy #2
|
2020-03-10 16:42:07 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.6 iny
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
bne .6
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
jsr SHARED.AddYp1ToPtr1
|
|
|
|
|
jsr SHARED.AddYp1ToPtr2
|
|
|
|
|
bra .40
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.7 ldy #$ff
|
|
|
|
|
|
|
|
|
|
.8 iny
|
|
|
|
|
jsr SHARED.FORPNT.GetY
|
|
|
|
|
bne .8
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
tya
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
adc #4
|
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
sta (ZPPtr1)
|
|
|
|
|
ldy #1
|
|
|
|
|
lda TXTPTR
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
iny
|
|
|
|
|
lda TXTPTR+1
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
lda ZPPtr1
|
|
|
|
|
clc
|
|
|
|
|
adc #3
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bcc .10
|
|
|
|
|
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.10 ldy #$ff
|
|
|
|
|
|
|
|
|
|
.11 iny
|
|
|
|
|
jsr SHARED.FORPNT.GetY
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
bne .11
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
sta (ZPPtr1),y StrV Ending \0
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.99 lda #E.OOM
|
2020-02-07 15:35:52 +00:00
|
|
|
|
sec
|
2021-04-29 11:56:34 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
STRVX.StrVGet jsr STRVX.GetID
|
|
|
|
|
bcs .9
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
lda ZPPtr1
|
|
|
|
|
* clc
|
|
|
|
|
adc #3
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bcc .1
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
|
|
|
|
.1 ldy #$ff
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
|
|
|
|
.5 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
jsr SHARED.FORPNT.PutY
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
>LDYA FORPNT
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.8 >LDYA ZPPtr1
|
|
|
|
|
clc
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.9 rts
|
2020-02-07 15:35:52 +00:00
|
|
|
|
*--------------------------------------
|
2021-04-29 11:56:34 +00:00
|
|
|
|
STRVX.StrVFree jsr K.FreeMem
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2021-04-29 11:56:34 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
STRVX.GetID jsr K.GetMemPtr
|
|
|
|
|
>STYA ZPPtr1 strV
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.1 lda (ZPPtr1)
|
|
|
|
|
beq .9
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
ldy #1
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp TXTPTR
|
|
|
|
|
bne .2
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
|
|
|
|
iny
|
2021-04-29 11:56:34 +00:00
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
cmp TXTPTR+1
|
|
|
|
|
beq .8
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.2 jsr STRVX.Next
|
|
|
|
|
bra .1
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2020-02-07 15:35:52 +00:00
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.9 lda #E.NOKEY
|
|
|
|
|
sec
|
2020-02-07 15:35:52 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-04-29 11:56:34 +00:00
|
|
|
|
STRVX.Next lda (ZPPtr1)
|
|
|
|
|
sec
|
|
|
|
|
adc ZPPtr1
|
|
|
|
|
sta ZPPtr1
|
|
|
|
|
bcc .8
|
2020-05-07 12:40:10 +00:00
|
|
|
|
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
|
2021-04-29 11:56:34 +00:00
|
|
|
|
.8 rts
|
2020-05-07 12:40:10 +00:00
|
|
|
|
*--------------------------------------
|
2020-02-07 15:35:52 +00:00
|
|
|
|
MAN
|
2020-12-15 13:23:22 +00:00
|
|
|
|
SAVE usr/src/sys/kernel.s.strvx
|
|
|
|
|
LOAD usr/src/sys/kernel.s
|
2020-02-07 15:35:52 +00:00
|
|
|
|
ASM
|