xref: /csrg-svn/lib/libc/hp300/string/strlen.s (revision 41816)
1*41816Sbostic/*-
2*41816Sbostic * Copyright (c) 1990 The Regents of the University of California.
3*41816Sbostic * All rights reserved.
4*41816Sbostic *
5*41816Sbostic * This code is derived from software contributed to Berkeley by
6*41816Sbostic * the Systems Programming Group of the University of Utah Computer
7*41816Sbostic * Science Department.
8*41816Sbostic *
9*41816Sbostic * %sccs.include.redist.c%
10*41816Sbostic */
11*41816Sbostic
12*41816Sbostic#if defined(LIBC_SCCS) && !defined(lint)
13*41816Sbostic	.asciz "@(#)strlen.s	5.1 (Berkeley) 05/12/90"
14*41816Sbostic#endif /* LIBC_SCCS and not lint */
15*41816Sbostic
16*41816Sbostic#include "DEFS.h"
17*41816Sbostic
18*41816SbosticENTRY(strlen)
19*41816Sbostic	moveq	#-1,d0
20*41816Sbostic	movl	sp@(4),a0	/* string */
21*41816Sbosticslloop:
22*41816Sbostic	addql	#1,d0		/* increment count */
23*41816Sbostic	tstb	a0@+		/* null? */
24*41816Sbostic	jne	slloop		/* no, keep going */
25*41816Sbostic	rts
26