.MCALL .MODULE .MODULE FNASC,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. .NLIST TOC,SYM .SBTTL ULBLIB 016 - Convert RAD50 file name to ASCII .PSECT .LIBC. .ENABL LC,GBL ;+ ; $FNASC ; The Convert File Name to ASCII routine converts a RAD50 device/file name ; block into the format "ddd:filnam.typ" with blank suppression. ; ; R0 -> File name ; R1 -> Output buffer ; ; CALL $FNASC ; ; R1 is updated past the end of the converted file name. ;- SPACE = 40 $FNASC:: JSR R5,$SAVRG ;Save non-volatile registers MOV R1,R4 ;Copy pointer to buffer MOV R0,R3 ;Copy pointer to file name TST @R0 ;Device name present? BNE 10$ ;Branch if so TST (R3)+ ;Skip the device name BR 20$ ; 10$: CALL 30$ ;Convert a word with blank suppression MOVB #':,(R1)+ ;Put in the ":" 20$: TST @R3 ;File name present? BEQ 50$ ;Branch if not. Done CALL 30$ ;Convert the file name CALL 30$ ; both words MOVB #'.,(R1)+ ;Put in the "." 30$: MOV (R3)+,R0 ;Get the RAD50 word CALL $R50ASC ;Convert it to ASCII 40$: CMPB #SPACE,-1(R1) ;Was the last character blank? BNE 50$ ;Branch if not DEC R1 ;Back up CMP R1,R4 ;Done? BNE 40$ ;Branch if not 50$: RETURN .NLIST TOC,SYM .TITLE $R50ASC .SBTTL ULBLIB 014 - RAD50 to ASCII conversion routine .IDENT \V01.02\ .PSECT .LIBC. .ENABL LC,GBL ;+ ; $R50ASC ; The RAD50 to ASCII routine converts one RAD50 word contained in R0 ; to ASCII and stores it in the area pointed to by R1. ; The unused RAD50 code (35) is converted to '*'. ; The RAD50 code for '.' is converted to '%'. ; ; R0 = The word to be converted ; R1 => The area to store the ASCII ; ; CALL $R50ASC ; ; R0 is destroyed ; R1 is updated past the end of the ASCII characters ;- ;>>>PSECT????? .WORD 0,1,50,50*50 DIVTAB: $R50ASC:: JSR R5,$SAVRG ;Save the non-volatile registers MOV #DIVTAB,R3 ;Point to divisor table 10$: TST -(R3) ;Backup through table - at end? BEQ 80$ ;If equal - yes. Done MOV #-1,R4 ;Init quotient register CMP #174777,R0 ;RAD50 value too large? BLO 40$ ;Yes - output "???" 20$: INC R4 ;Divide by power of 50(8) SUB @R3,R0 ; BCC 20$ ; ADD @R3,R0 ;Restore dividend TST R4 ;Character a blank? BEQ 50$ ;Yes CMP #35,R4 ;Digit? BLO 60$ ;Branch if so BNE 30$ ;Branch if alpha, $, or % ADD #4,R4 ;Correction for * 30$: CMP #33,R4 ;$ or % or *? BLOS 70$ ;Branch if so 40$: ADD #40,R4 ;Else alpha or "?" 50$: ADD #16,R4 ; 60$: ADD #11,R4 ; 70$: ADD #11,R4 ; MOVB R4,(R1)+ ;Store converted character BR 10$ ;Yes, continue 80$: RETURN ;And return to caller .END