2 ; 2017-07-05, Greg King
4 ; void cpeeks (char* s, unsigned length);
10 .importzp ptr1, ptr2, ptr3, tmp1, tmp2
11 .importzp CURS_X, CharPtr
18 eor #<$FFFF ; counting a word upward is faster
19 sta ptr3 ; so, we use -(length + 1)
32 sta tmp1 ; (will be a .Y index)
37 bze L3 ; branch always
42 lda (ptr2),y ; get char from system bank
48 and #<~$80 ; remove reverse bit
50 ; Convert the screen code into a PetSCII code.
64 @sk2: ;clc ; both above cmp and adc clear carry flag
74 L3: inc ptr3 ; count length
79 lda #$00 ; terminate the string