.MCALL .MODULE .MODULE INDGNB,VERSION=01,COMMENT= ; 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. .ENABL GBL,LC .SBTTL Macro definitions and internal data .MCALL DEFIN$ DEFIN$ ;Definitions for IND files .PSECT INDGNB .SBTTL $GNBLK,$NNBLK - Get next non-blank character ;+ ;$GNBLK - Get the next character from buffer and find next non-blank ;$NNBLK - Find the next non-blank starting with character in R2 ; This subroutine gets the next non-blank character and tests it ; for being an end of line character. ; ; Blank characters are: ; - horizontal tab (11) ; - space (40) ; ; End of line characters are: ; - null (0) ; - carriage return (15) ; - escape (33) ; ;Input: R0 -> Buffer ; R2 = The first character to be tested *** $NNBLK only *** ; ;Output:R0 -> Next character in buffer ; R2 = First non-blank found ; R1 = Number of blank characters found before non-blank character ; ; C-bit: ; Clear - no end of line found ; Set - End of line detected. End of line character is in R2 ;- .ENABL LSB $GNBLK::MOVB (R0)+,R2 ;Get next character $NNBLK::CLR R1 ;Initialize blank count 1$: CMPB R2,# ;Blank? BEQ 2$ ;Yes CMPB R2,# ;No, tab? BNE 3$ ;No 2$: INC R1 ;Yes,set blank found MOVB (R0)+,R2 ;Get next character BR 1$ ;Loop until non-blank ;+ ;Check for end of line. ;- 3$: CMPB R2,# ;Is it carriage return? BEQ 4$ ;Yes CMPB R2,# ;No, is it escape? BEQ 4$ ;Yes TST R2 ;Zero byte? BEQ 4$ ;Yes TST (PC)+ ;Make sure C-bit clear 4$: SEC ;Set end of line flag RETURN .DSABL LSB .END