xref: /original-bsd/lib/libc/vax/string/strlen.s (revision 576c43b3)
1/*
2 * Copyright (c) 1983 Regents of the University of California.
3 * All rights reserved.  The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
7#ifdef LIBC_SCCS
8	.asciz	"@(#)strlen.s	5.3 (Berkeley) 03/09/86"
9#endif LIBC_SCCS
10
11/*
12 * Return the length of cp (not counting '\0').
13 *
14 * strlen(cp)
15 *	char *cp;
16 */
17#include "DEFS.h"
18
19ENTRY(strlen, 0)
20	movl	4(ap),r1
211:
22	locc	$0,$65535,(r1)	# look for '\0'
23	beql	1b
24	subl3	4(ap),r1,r0	# len = cp - base
25	ret
26