.NLIST TOC,SYM .TITLE $C5TA .SBTTL ULBLIB 041 - RAD50 to ASCII conversion .IDENT \V03.00\ .PSECT .LIBC. .ENABL LC,GBL ; 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. ;+ ; $C5TA ; This routine converts RAD50 to ASCII. ; ; R0 -> first byte of output string ; R1 = RAD50 word to be converted ; ; CALL $C5TA ; ; R0 -> next byte after last character stored ;- $C5TA:: MOV R0,R2 ;Save byte address CALL CVTC ;Convert first character MOV R0,-(SP) ;Save it CALL CVTC ;Convert second character MOV R0,-(SP) ;Save it CALL CVTC ;Convert third character MOVB R0,(R2)+ ;Store it MOVB (SP)+,(R2)+ ;Store second character MOVB (SP)+,(R2)+ ;Store first character MOV R2,R0 ;Save terminal address RETURN ; ; Convert RAD50 character CVTC: MOV R1,R0 ;Dividend to R0 MOV #50,R1 ;Divisor to R1 CALL $DIV ;Divide em up MOV R1,-(SP) ;Save remainder MOV R0,R1 ;Quotient to R1 MOV (SP)+,R0 ;Retrieve remainder BEQ 3$ ;If EQ, blank CMP R0,#33 ;Test middle BLT 2$ ;If LT, alpha BEQ 1$ ;If EQ, dollar ADD #22-11,R0 ; 1$: ADD #11-100,R0 ; 2$: ADD #100-40,R0 ; 3$: ADD #40,R0 ; RETURN .END