.MCALL .MODULE .MODULE INDFEX,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 ;+ ;Macro calls. ;- .MCALL FDBDF$, FERDF$, DEFIN$ FDBDF$ ;Define file offsets. FERDF$ ;Define file service error codes DEFIN$ ;Definitions for IND files .PSECT INDFEX .SBTTL FILSTR - Expand file specification ;+ ;FILSTR ;Using the FDB, this routine expands the filespec and stores it in . ; ; Input: R0 -> current FDB ; ; Output: R0 remains unchanged. ; R2,R3 are modified. ;- .ENABL LSB FILSTR::SAVE MOV R0,R3 ;Copy the FDB address ADD #F$DNAM,R3 ;Point to the device name offset. MOV #FILSPC+SEVAL,R0 ;Point to the string storage address ;+ ;Convert the file name. ;- MOV (R3)+,R1 ;Get device name. CALL CVT ;Convert to 3 ASCII characters. MOVB #,(R0)+ ;Store ":" after device spec. MOV @SP,R1 ;Get FDB for quick check CMP #,F$ERR(R1) ;Was there a invalid device or unit error? BEQ 2$ ;No filename calculate STRLEN and exit MOV (R3)+,R1 ;Get first half of file name. BEQ 2$ ;No file name calculate string lenght and exit CALL CVT ;Convert to 3 ASCII characters MOV (R3)+,R1 ;Get second half of file name CALL CVT ;Convert to 3 ASCII characters ;+ ;Now convert the file type. ;- 1$: MOVB #,(R0)+ ;Store separator MOV (R3)+,R1 ;Get the file type CALL CVT ;Convert to 3 ASCII characters ;+ ;Conversion complete. ;- 2$: SUB #FILSPC+SEVAL,R0 ;Compute the length of the string MOVB R0,FILSPC+SELEN ; and store it RESTOR RETURN .DSABL LSB .SBTTL CVT - Convert RAD50 file name to ASCII. ;+ ;CVT ;Converts a RAD50 word in R1 to an ASCII string. Performs trailing blank ;suppression, and returns with the C-bit set if there were any trailing ;blanks. ; ;Input: R0 -> Buffer to store ASCII string ; R1 = RAD50 word ;- .ENABL LSB CVT: TST R1 ;Is anything there? BEQ 2$ ;No, there is nothing. Done. CALL $C5TA ;Convert to a string CMPB -(R0),# ;Is it a space? BNE 1$ ;No, everything is fine. No trailing space CMPB -(R0),# ;Is the second to last also a space? BNE 1$ ;Branch if no CMPB -(R0),# ;Is the third to last also a space? BEQ 2$ ;Branch if yes 1$: INC R0 ;Point back past the character that worked 2$: RETURN .DSABL LSB .END