Commit | Line | Data |
---|---|---|
586c39b1 DF |
1 | /* |
2 | * Copyright (c) 1983 Regents of the University of California. | |
493b70ca KB |
3 | * All rights reserved. |
4 | * | |
019bea33 | 5 | * %sccs.include.redist.c% |
586c39b1 DF |
6 | */ |
7 | ||
f4f66d2c | 8 | #if defined(LIBC_SCCS) && !defined(lint) |
019bea33 | 9 | .asciz "@(#)strlen.s 5.6 (Berkeley) %G%" |
f4f66d2c | 10 | #endif /* LIBC_SCCS and not lint */ |
505d9394 SL |
11 | |
12 | /* | |
13 | * Return the length of cp (not counting '\0'). | |
14 | * | |
15 | * strlen(cp) | |
16 | * char *cp; | |
17 | */ | |
dadab5a2 | 18 | #include "DEFS.h" |
505d9394 | 19 | |
dadab5a2 | 20 | ENTRY(strlen, 0) |
66d466fb KM |
21 | movl 4(ap),r1 |
22 | 1: | |
23 | locc $0,$65535,(r1) # look for '\0' | |
24 | beql 1b | |
25 | subl3 4(ap),r1,r0 # len = cp - base | |
505d9394 | 26 | ret |