.MCALL .MODULE .MODULE DEVTR,VERSION=05,COMMENT=<$DEVTR/SYSLIB>,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. .SBTTL Module Declaration .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ; FACILITY: ; ; RT-11 System Subroutine Library ; ; CALLABLE ENTRIES: ; ; $DEVTR ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB .SBTTL DEVTR - SYSLIB service routine ; ;++ ; ; Translates RAD50 device name(one or two character) and BINARY unit number ; to RAD50 format of device name and unit number. ; ; INPUT ; R0 = RAD50 dev name, one or two character ; R1 = Binary unit number ; ; This routine assumes that if the device name is two characters, ; then the unit number is 7 or less. It does not chop off the ; second letter of a passed device name. ; ; It does, however, insert a zero for units less than or equal to ; 7, when a one-letter device name is passed. ; ; OUTPUT ; R0 = RAD50 dev name + unit number ; R1 = Destroyed ; ; OUTPUT FORMAT: ; ; DDn - any device with device unit # 0 - 7 ; Dnn - 64 unit device with unit # 10 - 77 ; ;-- ; .PSECT SYS$I .ENABL LSB $DEVTR:: MOV R0,-(SP) ;Copy for type determination 10$: SUB #<^RA >,@SP ;Is it one or two character? BHI 10$ ;Loop to determine BNE 20$ ;Branch if two-character (not 64unit) ; A one-letter (64-unit) name has been found, do proper unit conversion. ADD R1,R0 ;Add low_ord_unit + high_ord_unit*10 BIC #^C70,R1 ;Isolate high_ord_unit*10 ASL R1 ;High_ord_unit*20 ASL R1 ;High_ord_unit*40 ADD #<^R 0 >,R0 ;Add base RAD50 zero for high digit 20$: ADD #<^R 0>,R0 ;Add base RAD50 zero for low digit ADD R1,R0 ;Add (high_ord_unit*40) to accumulator ;Result = letter + ; TST (SP)+ ;Fix stack RETURN ;Done .DSABL LSB .END