A2osX/SYS/KERNEL.S.STRV.txt

75 lines
1.3 KiB
Plaintext
Raw Normal View History

2020-01-24 14:21:08 +00:00
NEW
AUTO 3,1
*/--------------------------------------
2020-03-09 16:24:08 +00:00
* # StrVGet
2020-01-30 14:59:40 +00:00
* ## ASM
* `>PUSHB hSTRV`
* `>PUSHB index`
2020-03-09 16:24:08 +00:00
* `>PUSHW ptr`
* `>SYSCALL StrVGet`
2020-01-24 14:21:08 +00:00
* ## RETURN VALUE
2020-03-09 16:24:08 +00:00
* CC: Y,A = Ptr
* CS: Y,A = NULL
2020-01-24 14:21:08 +00:00
*\--------------------------------------
2020-03-09 16:24:08 +00:00
K.StrVGet >PULLW FORPNT ptr
2020-01-24 14:21:08 +00:00
*/--------------------------------------
2020-03-09 16:24:08 +00:00
* # StrVShift
2020-01-28 16:42:51 +00:00
* ## ASM
* `>PUSHB hSTRV`
2020-01-30 14:59:40 +00:00
* `>PUSHB index`
2020-03-09 16:24:08 +00:00
* `>SYSCALL StrVShift`
2020-01-24 14:21:08 +00:00
* ## RETURN VALUE
*\--------------------------------------
2020-03-09 16:24:08 +00:00
K.StrVShift >PULLA index
2020-01-28 16:42:51 +00:00
eor #$ff
2020-03-10 16:42:07 +00:00
tay
2020-03-09 16:24:08 +00:00
2020-03-10 16:42:07 +00:00
>PULLA hSTRV
jmp K.SYSCALL.JMPX
2020-01-28 16:42:51 +00:00
*/--------------------------------------
* # StrVAdd
* ## ASM
* `>PUSHB hSTRV`
* `>PUSHW str`
* `>SYSCALL StrVAdd`
* ## RETURN VALUE
2020-01-30 14:59:40 +00:00
* CC : str added to hSTRV
* CS : hSTRV full
2020-01-28 16:42:51 +00:00
*\--------------------------------------
2020-02-07 15:35:52 +00:00
K.StrVAdd >PULLW TXTPTR str
2020-01-30 14:59:40 +00:00
>PULLA
2020-03-10 16:42:07 +00:00
jmp K.SYSCALL.JMPX
2020-01-28 16:42:51 +00:00
*--------------------------------------
2020-03-12 16:44:11 +00:00
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
*--------------------------------------
2020-01-24 14:21:08 +00:00
MAN
2020-12-15 13:23:22 +00:00
SAVE usr/src/sys/kernel.s.strv
LOAD usr/src/sys/kernel.s
2020-01-24 14:21:08 +00:00
ASM