.MCALL .MODULE .MODULE LEN,VERSION=03,COMMENT=,IDENT=NO,LIB=YES ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .SBTTL LEN - FORTRAN CALLABLE SUBROUTINE ; ; I = LEN(A) ; ; THIS FUNCTION RETURNS THE LENGTH IN CHARACTERS OF THE STRING ; CURRENTLY CONTAINED IN ARRAY A. THE LENGTH IS COMPUTED AS THE ; NUMBER OF NON-ZERO BYTES ENCOUNTERED BEFORE THE FIRST NULL ; (ZERO) BYTE. ; ; MAS .PSECT SYS$I .GLOBL $SYSLB LEN:: TST (R5)+ ;SKIP # OF ARGS MOV @R5,R0 ;GET STRING POINTER 10$: TSTB (R0)+ ;FIND END OF STRING BNE 10$ ;LOOP UNTIL NULL BYTE DEC R0 ;BACK UP SUB @R5,R0 ;CALC NUMBER OF CHARS IN STRING RETURN .END