mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-23 07:35:19 +00:00
100 lines
1.7 KiB
Plaintext
100 lines
1.7 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*/--------------------------------------
|
||
* # StrVGet
|
||
* ## ASM
|
||
* `>PUSHB hSTRV`
|
||
* `>PUSHB index`
|
||
* `>PUSHW ptr`
|
||
* `>SYSCALL StrVGet`
|
||
* ## RETURN VALUE
|
||
* CC: Y,A = Ptr
|
||
* CS: Y,A = NULL
|
||
*\--------------------------------------
|
||
K.StrVGet >PULLW FORPNT ptr
|
||
*/--------------------------------------
|
||
* # StrVShift
|
||
* ## ASM
|
||
* `>PUSHB hSTRV`
|
||
* `>PUSHB index`
|
||
* `>SYSCALL StrVShift`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.StrVShift >PULLA index
|
||
eor #$ff
|
||
tay
|
||
|
||
>PULLA hSTRV
|
||
jmp K.SYSCALL.JMPX
|
||
*/--------------------------------------
|
||
* # StrVAdd
|
||
* ## ASM
|
||
* `>PUSHB hSTRV`
|
||
* `>PUSHW str`
|
||
* `>SYSCALL StrVAdd`
|
||
* ## RETURN VALUE
|
||
* CC : str added to hSTRV
|
||
* CS : hSTRV full
|
||
*\--------------------------------------
|
||
K.StrVAdd >PULLW TXTPTR str
|
||
>PULLA
|
||
jmp K.SYSCALL.JMPX
|
||
*--------------------------------------
|
||
STRV.NStrPtr1 ldy #$ff
|
||
|
||
.1 iny
|
||
|
||
lda (ZPPtr1)
|
||
beq .2
|
||
|
||
inc ZPPtr1
|
||
bne .1
|
||
inc ZPPtr1+1
|
||
bra .1
|
||
|
||
.2 tya
|
||
beq .9
|
||
|
||
inc ZPPtr1
|
||
bne .8
|
||
inc ZPPtr1+1 skip \0
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
.9 sec Y,A = 0
|
||
rts
|
||
*--------------------------------------
|
||
STRV.Ptr1Ptr2cpy
|
||
ldx #0
|
||
ldy #0
|
||
|
||
.4 lda (ZPPtr1),y
|
||
sta (ZPPtr2),y
|
||
beq .6
|
||
|
||
.5 iny
|
||
bne .4
|
||
|
||
inc ZPPtr1+1
|
||
inc ZPPtr2+1
|
||
bra .4
|
||
|
||
.6 inx
|
||
|
||
iny
|
||
bne .7
|
||
|
||
inc ZPPtr1+1
|
||
inc ZPPtr2+1
|
||
|
||
.7 lda (ZPPtr1),y
|
||
sta (ZPPtr2),y Ending \0 ?
|
||
bne .5
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE USR/SRC/SYS/KERNEL.S.STRV
|
||
LOAD USR/SRC/SYS/KERNEL.S
|
||
ASM
|