2 ; Ullrich von Bassewitz, 11.06.1998
4 ; size_t strspn (const char* s1, const char* s2);
9 .importzp ptr1, ptr2, tmp1, tmp2, tmp3
17 ldx #0 ; low counter byte
18 stx tmp1 ; high counter byte
21 L1: lda (ptr1),y ; get next char from s1
27 L2: sty tmp3 ; save index into s1
29 ldy #0 ; get index into s2
37 ; The character was found in s2. Increment the counter and start over
39 L4: ldy tmp3 ; reload index
45 ; The character was not found, or we reached the end of s1. Return count of
48 L6: txa ; get low counter byte
49 ldx tmp1 ; get high counter byte