strlen.s revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * Given string s, return length (not including the terminating null). 2N/A * Fast assembler language version of the following C-program strlen 2N/A * which represents the `standard' for the C-library. 2N/A * register const char *s; 2N/A * register const char *s0 = s + 1; 2N/A * while (*s++ != '\0') 2N/A ! finding null bytes. If we are not aligned, the string is 2N/A ! checked a byte at a time until it is. Once this occurs, 2N/A ! we can proceed word-wise across it. Once a word with a 2N/A ! zero byte has been found, we then check the word a byte