2 ; Ullrich von Bassewitz, 31.05.1998
4 ; const char* strchr (const char* s, int c);
18 Loop: lda (ptr1),y ; Get next char
19 beq EOS ; Jump on end of string
21 beq Found ; Jump if yes
25 bne Loop ; Branch always
27 ; End of string. Check if we're searching for the terminating zero
29 EOS: lda tmp1 ; Get the char we're searching for
30 bne NotFound ; Jump if not searching for terminator
32 ; Found. Calculate pointer to c.
34 Found: ldx ptr1+1 ; Load high byte of pointer
42 ; Not found, return NULL