2 ; Ullrich von Bassewitz, 09.06.1998
4 ; void* memchr (const void* p, int c, size_t n);
9 .importzp ptr1, ptr2, tmp1
23 ldx ptr2 ; use X as low counter byte
24 beq L3 ; check high byte
29 beq L5 ; jump if found
37 L3: ldx ptr2+1 ; Check high byte
38 beq L4 ; Jump if counter off
41 bne L1 ; branch always
43 ; Character not found, return zero
47 ; Character found, calculate pointer
49 L5: ldx ptr1+1 ; get high byte of pointer