xref: /csrg-svn/lib/libc/hp300/string/strlen.s (revision 61123)
141816Sbostic/*-
2*61123Sbostic * Copyright (c) 1990, 1993
3*61123Sbostic *	The Regents of the University of California.  All rights reserved.
441816Sbostic *
541816Sbostic * This code is derived from software contributed to Berkeley by
641816Sbostic * the Systems Programming Group of the University of Utah Computer
741816Sbostic * Science Department.
841816Sbostic *
941816Sbostic * %sccs.include.redist.c%
1041816Sbostic */
1141816Sbostic
1241816Sbostic#if defined(LIBC_SCCS) && !defined(lint)
13*61123Sbostic	.asciz "@(#)strlen.s	8.1 (Berkeley) 06/04/93"
1441816Sbostic#endif /* LIBC_SCCS and not lint */
1541816Sbostic
1641816Sbostic#include "DEFS.h"
1741816Sbostic
1841816SbosticENTRY(strlen)
1941816Sbostic	moveq	#-1,d0
2041816Sbostic	movl	sp@(4),a0	/* string */
2141816Sbosticslloop:
2241816Sbostic	addql	#1,d0		/* increment count */
2341816Sbostic	tstb	a0@+		/* null? */
2441816Sbostic	jne	slloop		/* no, keep going */
2541816Sbostic	rts
26