2 ; Ullrich von Bassewitz, 11.06.1998
4 ; char* strpbrk (const char* s1, const char* s2);
8 .import popax, popptr1, return0
9 .importzp ptr1, ptr2, tmp1, tmp2, tmp3
16 ; ldy #$00 Y=0 guaranteed by popptr1
18 L1: lda (ptr1),y ; get next char from s1
24 L2: sty tmp3 ; save index into s1
26 ldy #0 ; get index into s2
34 ; The character was not found in s2. Increment the counter and start over
36 L4: ldy tmp3 ; reload index
42 ; A character was found. Calculate a pointer to this char in s1 and return it.
45 lda tmp3 ; get y offset
52 ; None of the characters in s2 was found - return NULL