2 ; 1998-06-11, Ullrich von Bassewitz
3 ; 2018-05-29, Greg King
5 ; char* __fastcall__ strpbrk (const char* str, const char* set);
11 .importzp ptr1, ptr2, tmp2, tmp3
17 stx ptr1+1 ; store str's high byte
20 tay ; use str's low byte as index
22 L1: lda (ptr1),y ; get next char from str
25 sty tmp3 ; save index into str
28 L3: lda (ptr2),y ; look at each char in set
31 beq L6 ; break out of loops if something found
35 ; The character was not found in set. Increment the counter; and start over.
37 L4: ldy tmp3 ; reload index
41 bne L1 ; branch always
43 ; A character was found. Return its str pointer.
46 lda tmp3 ; get .Y offset
49 ; None of the characters in set was found -- return NULL.
51 L9: ;ldx #>$0000 ; (set by prolog)
52 ;lda #<$0000 ; (set by '\0' at end of str)