A2osX/SYS/KERNEL.S.STRVX.txt

196 lines
2.5 KiB
Plaintext
Raw Permalink Normal View History

2020-02-07 15:35:52 +00:00
NEW
AUTO 3,1
*--------------------------------------
2021-05-04 17:31:21 +00:00
STRVX.StrVFree jsr K.FreeMem
clc
rts
*--------------------------------------
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
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
ldy #$ff
.1 iny
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTgY
2021-04-29 11:56:34 +00:00
bne .1
tya
2021-05-15 14:35:24 +00:00
* clc
2021-04-29 11:56:34 +00:00
adc #4 LEN+IDlo+IDhi+\0
2021-05-15 14:35:24 +00:00
bcs .9
2021-04-29 11:56:34 +00:00
cmp (ZPPtr1)
bne .4
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
lda ZPPtr1 Same Length, replace
clc
adc #3
sta ZPPtr1
bcc .2
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
inc ZPPtr1+1
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
.2 ldy #$ff
.3 iny
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTgY
2021-04-29 11:56:34 +00:00
sta (ZPPtr1),y
bne .3
2021-05-15 14:35:24 +00:00
2020-02-07 15:35:52 +00:00
clc
2021-05-15 14:35:24 +00:00
.9 rts
2020-02-07 15:35:52 +00:00
*--------------------------------------
2021-04-29 11:56:34 +00:00
.4 >LDYA ZPPtr1
>STYA ZPPtr2
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
jsr STRVX.Next
2020-03-10 16:42:07 +00:00
2021-04-29 11:56:34 +00:00
.40 lda (ZPPtr1)
2021-05-15 14:35:24 +00:00
beq .6
tax
ldy #0
2021-04-29 11:56:34 +00:00
.5 lda (ZPPtr1),y
sta (ZPPtr2),y
2021-05-15 14:35:24 +00:00
iny
dex
bne .5
jsr SHARED.AddY2P1
jsr SHARED.AddY2P2
2021-04-29 11:56:34 +00:00
bra .40
2021-05-15 14:35:24 +00:00
.6 >LDYA ZPPtr2
>STYA ZPPtr1
2021-04-29 11:56:34 +00:00
*--------------------------------------
.7 ldy #$ff
.8 iny
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTgY
2021-04-29 11:56:34 +00:00
bne .8
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
tya
clc
adc #4
bcs .99
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
sta (ZPPtr1)
ldy #1
lda TXTPTR
sta (ZPPtr1),y
iny
lda TXTPTR+1
sta (ZPPtr1),y
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
lda ZPPtr1
clc
adc #3
sta ZPPtr1
bcc .10
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
inc ZPPtr1+1
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
.10 ldy #$ff
.11 iny
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTgY
2021-04-29 11:56:34 +00:00
sta (ZPPtr1),y
bne .11
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
iny
sta (ZPPtr1),y StrV Ending \0
2021-05-15 14:35:24 +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
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
lda ZPPtr1
* clc
adc #3
sta ZPPtr1
bcc .1
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
inc ZPPtr1+1
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
.1 ldy #$ff
2020-02-07 15:35:52 +00:00
.5 iny
lda (ZPPtr1),y
2021-05-04 17:31:21 +00:00
jsr SHARED.FORPNTpY
2021-05-15 14:35:24 +00:00
bne .5
2020-02-07 15:35:52 +00:00
>LDYA FORPNT
clc
rts
2021-05-15 14:35:24 +00:00
2020-02-07 15:35:52 +00:00
.8 >LDYA ZPPtr1
clc
2021-05-15 14:35:24 +00:00
.9 rts
2020-02-07 15:35:52 +00:00
*--------------------------------------
2021-04-29 11:56:34 +00:00
STRVX.GetID jsr K.GetMemPtr
>STYA ZPPtr1 strV
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
.1 lda (ZPPtr1)
beq .9
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
ldy #1
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
lda (ZPPtr1),y
cmp TXTPTR
bne .2
2021-05-15 14:35:24 +00:00
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
2021-05-15 14:35:24 +00:00
2021-04-29 11:56:34 +00:00
.2 jsr STRVX.Next
bra .1
2021-05-15 14:35:24 +00:00
.8 clc
2021-04-29 11:56:34 +00:00
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)
2021-05-14 20:58:20 +00:00
clc
2021-04-29 11:56:34 +00:00
adc ZPPtr1
sta ZPPtr1
bcc .8
2021-05-15 14:35:24 +00:00
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