2 * (c) Copyright 1986 HEWLETT-PACKARD COMPANY
4 * To anyone who acknowledges that this file is provided "AS IS"
5 * without any express or implied warranty:
6 * permission to use, copy, modify, and distribute this file
7 * for any purpose is hereby granted without fee, provided that
8 * the above copyright notice and this notice appears in all
9 * copies, and that the name of Hewlett-Packard Company not be
10 * used in advertising or publicity pertaining to distribution
11 * of the software without specific, written prior permission.
12 * Hewlett-Packard Company makes no representations about the
13 * suitability of this software for any purpose.
16 /* SPECTRUM_ID: @(#)memchr.s 37.4 86/04/23 */
20 * returns pointer to first occurrence of char c
21 * in first n characters of memory area s,
22 * or null if c does not occur.
33 comb,<= COUNT,r0,memchrexit /* return if count is zero */
34 copy r0,ret0 /* null if c not found in n chars */
35 depi 0,23,24,CHAR /* make char unsigned */
39 comb,=,n TEMP1,CHAR,memchrequal
40 addib,<> -1,COUNT,memchrloop