.NLIST TOC,SYM .TITLE $ASCR50 .SBTTL ULBLIB 018 - ASCII to RAD50 conversion routine .IDENT \V01.01\ .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. ;+ ; $ASCR50 ; The ASCII to RAD50 routine converts three ASCII characters pointed to by ; R1 to one RAD50 word contained in R0. ; ; R1 => The area containing the ASCII characters ; ; CALL $ASCR50 ; ; R0 = RAD50 word ; R1 is updated past the end of the ASCII characters ;- $ASCR5:: JSR R5,$SAVRG ;Save non-volatile registers MOV #3,R5 ;Number of characters to convert CLR R0 ;Clear accumulator 1$: CLR R4 ;Move byte coming MOVB (R1)+,R4 ;Get the first character CMP #40,R4 ;Is it a blank? BEQ 2$ ;Branch if so CMP #52,R4 ;How about a *? BEQ 4$ ;Branch if so BHI 5$ ;Branch if $ or % CMP #100,R4 ;How about a digit? BHI 3$ ;Branch if so SUB #40,R4 ;Else alpha 2$: SUB #16,R4 ; 3$: SUB #5,R4 ; 4$: SUB #4,R4 ; 5$: SUB #11,R4 ; ASL R0 ; * 2 ASL R0 ; * 4 ASL R0 ; *10 MOV R0,-(SP) ;Save it ASL R0 ; *20 ASL R0 ; *40 ADD (SP)+,R0 ; *50 ADD R4,R0 ;Add in the next character DEC R5 ;Done BNE 1$ ;Branch if not RETURN .END