.NLIST TOC,SYM .TITLE $DMUL .SBTTL ULBLIB 036 - Double Precision Multiply .IDENT \V01.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. ;+ ; $DMUL ; This routine multiplies a double precision multiplicand by a single ; precision multiplier and yields a double precision result. All are ; unsigned. ; ; R0 = single precision multiplier ; R2 = hi-order part of double precision multiplicand ; R3 = lo-order part of double precision multiplicand ; ; JSR PC,$DMUL ; ; C-bit = 0 ; R0 = hi-order part of double precision multiplicand ; R1 = lo-order part of double precision multiplicand ; R2,R3 = random ;- $DMUL:: MOV R0,-(SP) ;Single precision multiplier CLR R0 ;Initialize the result CLR R1 ;Both words 1$: TST (SP) ;If remaining multiplier is zero, BEQ 3$ ; then all through ROR (SP) ;If next bit is a one, BCC 2$ ; ADD R3,R1 ; then add multiplicand to result ADC R0 ;Add in carry ADD R2,R0 ;Add in hi-order part 2$: ASL R3 ;In either case, double the multiplicand, ROL R2 ; BR 1$ ; and see if any more multiplier 3$: TST (SP)+ ;Clean up the stack, return C-bit = 0 RETURN .END