$MULQ - QUAD MULTIPLY ROUTINE	MACRO M1110  21-AUG-78 21:29  PAGE 3





      1						.TITLE	$MULQ - QUAD MULTIPLY ROUTINE

      2

      3						.IDENT	"V0002"

      4					;

      5					; COPYRIGHT (C) 1976 BY DIGITAL EQUIPMENT CORPORATION,

      6					; MAYNARD, MASSACHUSETTS

      7					;

      8					; THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY ON A

      9					; SINGLE  COMPUTER  SYSTEM AND MAY BE COPIED ONLY WITH THE IN-

     10					; CLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE,  OR

     11					; ANY  OTHER  COPIES THEREOF, MAY NOT BE PROVIDED OR OTHERWISE

     12					; MADE AVAILABLE TO ANY OTHER PERSON EXCEPT FOR  USE  ON  SUCH

     13					; SYSTEM  AND TO ONE WHO AGREES TO THESE LICENSE TERMS.  TITLE

     14					; TO AND OWNERSHIP OF THE SOFTWARE SHALL AT ALL  TIMES  REMAIN

     15					; IN DIGITAL.

     16					;

     17					; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITH-

     18					; OUT  NOTICE  AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY

     19					; DIGITAL EQUIPMENT CORPORATION.

     20					;

     21					; DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY  FOR

     22					; THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT WHICH IS

     23					; NOT SUPPLIED BY DIGITAL.

     24					;

     25					; ANDREW C. GOLDSTEIN  17-NOV-76  10:45

     26

     27

     28					;+

     29					;

     30					; *** - $MULQ	QUAD MULTIPLY ROUTINE

     31					;

     32					; THIS ROUTINE DOES A 64 BIT MULTIPLY OPERATION (ALL OPERANDS ARE

     33					; 64 BITS IN LENGTH). NUMBERS ARE STORED WITH INCREASING

     34					; SIGNIFICANCE IN INCREASING ADDRESSED BYTES.

     35					;

     36					; INPUTS:

     37					;

     38					;	R0 = ADDRESS OF MULTIPLIER

     39					;	R1 = ADDRESS OF MULTIPLICAND

     40					;	R2 = ADDRESS OF PRODUCT

     41					;

     42					; OUTPUTS:

     43					;

     44					;	PRODUCT STORED IN SPECIFIED ADDRESS

     45					;

     46					;-

     47

     48	000000				$MULQ::

     49	000000	004767 	000000G			CALL	$SAVAL

     50	000004	012746 	000100 			MOV	#64.,-(SP)	; SET UP ITERATION COUNT

     51	000010	010204 				MOV	R2,R4		; POINT TO PRODUCT

     52	000012	005024 				CLR	(R4)+		; ZERO THE PRODUCT

     53	000014	005024 				CLR	(R4)+

     54	000016	005024 				CLR	(R4)+

     55	000020	005024 				CLR	(R4)+

     56	000022	062700 	000010 			ADD	#8.,R0		; POINT TO HIGH ORDER OF MULTIPLIER

     57

$MULQ - QUAD MULTIPLY ROUTINE	MACRO M1110  21-AUG-78 21:29  PAGE 3-1





     58	000026	005005 			10$:	CLR	R5		; INITIALIZE MASK

     59	000030	005740 				TST	-(R0)		; MOVE TO NEXT LOWER WORD OF MULTIPLIER

     60	000032	000261 				SEC

     61	000034	006005 			20$:	ROR	R5		; SHIFT TO NEXT LOWER BIT

     62	000036	103773 				BCS	10$		; MOVE TO NEXT WORD IF NECESSARY

     63

     64	000040	010204 				MOV	R2,R4		; POINT TO PRODUCT

     65	000042	006124 				ROL	(R4)+		; SHIFT IT LEFT ONE PLACE

     66	000044	006124 				ROL	(R4)+

     67	000046	006124 				ROL	(R4)+

     68	000050	006124 				ROL	(R4)+

     69	000052	030510 				BIT	R5,(R0)		; SEE IF BIT OF MULTIPLIER IS ON

     70	000054	001416 				BEQ	30$		; BRANCH IF NOT - NO ADD

     71	000056	010103 				MOV	R1,R3		; POINT TO MULTIPLICAND

     72	000060	010204 				MOV	R2,R4		; POINT TO PRODUCT

     73	000062	062324 				ADD	(R3)+,(R4)+	; ADD MULTIPLICAND INTO PRODUCT

     74	000064	005524 				ADC	(R4)+

     75	000066	005524 				ADC	(R4)+

     76	000070	005514 				ADC	(R4)

     77	000072	024444 				CMP	-(R4),-(R4)

     78	000074	062324 				ADD	(R3)+,(R4)+

     79	000076	005514 				ADC	(R4)

     80	000100	005564 	000002 			ADC	2(R4)

     81	000104	062324 				ADD	(R3)+,(R4)+

     82	000106	005514 				ADC	(R4)

     83	000110	062324 				ADD	(R3)+,(R4)+

     84	000112	000241 			30$:	CLC			; CLEAR CARRY FOR ABOVE ROTATE

     85	000114	005316 				DEC	(SP)		; BUMP STEP COUNT

     86	000116	001346 				BNE	20$		; AND LOOP

     87

     88	000120	005726 				TST	(SP)+		; CLEAN THE STACK

     89	000122					RETURN

     90

     91

     92

     93		000001 				.END

$MULQ - QUAD MULTIPLY ROUTINE	MACRO M1110  21-AUG-78 21:29  PAGE 3-2

SYMBOL TABLE



IIII  = 177777   	$E$   = 000001   	$L$   = 000000   	$R    = 177777   	$SUPMC= 000043

$DIDDO= 000000   	$L    = 000000   	$MULQ   000000RG 	$SAVAL= ****** GX	$T    = 000000

$EF$  = 000000



. ABS.	000000	   000

      	000124	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  11150 WORDS  ( 44 PAGES)

DYNAMIC MEMORY:  12276 WORDS  ( 47 PAGES)

ELAPSED TIME:  00:00:17

EXE$:MULQ,LIS$:MULQ/-SP=SRC$:SMAC/PA:1,DSCPRE,MULQ

