.MCALL .MODULE .MODULE R50ASC,VERSION=05,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. ;++ ; ; Edit Who Date Description of modification ; ---- --- ---- --------------------------- ; 001 WLD 15-OCT-90 Standardize PSECT names. ;-- .SBTTL Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; CALLABLE ENTRIES: ; ; R50ASC, $RD5ASC ; ; ENVIRONMENT: ; ; This routine can be used by any job running in a single-job ; or multi-job environment. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB ; Include system library work area .GLOBL $NXVAL ; .GLOBL $NXADR ; .GLOBL $ERRP0 ; Entry point to EMT error conversion routine .WEAK $MSARG ; Trap code for missing argument .SBTTL R50ASC - Fortran-callable routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; R50ASC - Converts a specified number of Radix-50 characters to ASCII. ; ; CALLING SEQUENCE: ; ; CALL R50ASC( icnt, input, output ) ; ; INPUT PARAMETERS: ; ; R5 - address of R50ASC argument block ; 0(R5) - argument count of R50ASC call ; 2(R5) - address of integer number of ASCII characters to be produced ; 4(R5) - address of area from which words of Radix-50 values to be con- ; verted are taken ; 6(R5) - address of the area into which the ASCII characters are stored ; ; OUTPUT PARAMETERS: ; ; output - converted ASCII characters ; ;-- .SBTTL $RD5AS - SYSLIB service rouitne ; ; $RD5AS - converts one word in RD50 format into ASCII ; ; CALLING SEQUENCE: CALL $RD5ASC ; ; INPUT PARAMETERS: ; ; R0 - input string ; R5 -> output area ; ; output - converted ASCII characters ; .PSECT SYS$I,I $RD5AS:: ; Entry point to one RAD50 word to ASCII ; cnversion routine MOV #3,R1 ; R1 = number of characters in one RAD50 word BR CNTN R50ASC:: ; Entry point to RAD50 to ASCII convertion ; rouitne MOV (R5)+,R4 ;R4(low byte) <- arg count CALL $NXVAL ; get 'icnt' # of characters to output BCS ERR ; If CS, error - 'icnt' wasn't supplied MOV R0,R1 ; R1 = # of chars to output CALL $NXADR ; get 'input' arg - address of input area BCS ERR ; If CS, error - "input' arg wasn't supplied MOV R0,R2 ; R2 -> input area CALL $NXADR ; Get 'output' arg - addres of output area BCS ERR ; If CS, error - 'output' wasn't supplied MOV R0,R5 ; R5 -> output area NXWRD: MOV (R2)+,R0 ; R0 = current input word CNTN: MOV #DIVTAB,R3 ; R3 -> division table 1$: TST -(R3) ; new word required yet? BEQ NXWRD ; yes MOV #-1,R4 ; initialize quotient reg CMP #174777,R0 ; RAD50 value too large? BLO 4$ ; yes - output question marks 3$: INC R4 ; divide by appropriate power of 50(8) SUB @R3,R0 BCC 3$ ADD @R3,R0 ; restore dividend TST R4 ; character is a blank? BEQ 5$ ; yes CMP #33,R4 ; dollar sign, period, or digit? BLO 6$ ; period or digit BEQ 7$ ; dollar sign 4$: ADD #40,R4 ; else alpha (A-Z) or question mark ; (see above) 5$: ADD #16,R4 ; 6$: ADD #11,R4 ; 7$: ADD #11,R4 ; 8$: MOVB R4,(R5)+ ; store converted character in output DEC R1 ; any more chars to produce? BNE 1$ ; yes RETURN ERR: TRAP $MSARG ; handle any missing argument in call RETURN .PSECT SYS$S,D .WORD 0 ;END-OF-TABLE FLAG .WORD 1 .WORD 50 .WORD 3100 DIVTAB= . ;RAD50 DIVISION TABLE .END