/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/COPYRIGHT 1971, 1973 DIGITAL EQUIPMENT CORP., MAYNARD MASS.
/EDIT #004  8 JAN 73  T.A.M.
/           5-24-71  *REF*
	.TITLE	.BI	/MIXED POWERS OF INTEGERS AND DBL INTEGERS
/CALLING SEQUENCE:
/I**J
/	JMS* .BI	/S.I.(I) IN CPU AC
/	ADDR		ADDR OF D.I.(J) POWER(XCT ADDR IF INDIRECT)
/	NEXT INSTR.	SUBR RETURN(RESULT IN AC,MQ(FPP AC))
/J**I
/	JMS* .BK	D.I.(J) IN CPU AC-MQ(FPP AC)
/	ADDR	ADDR OF S.I.(I) (XCT ADDR IF INDIRECT)
/	NEXT INSTR.	SUBR. RETURN(RESULT IN AC-MQ(FPP AC))
/J**J
/	JMS* .BJ	D.I.(J) IN CPU AC-MQ(FPP AC)
/	ADDR		ADDR OF D.I.(XCT ADDR IF INDIRECT)
/	NEXT INSTR.	SUBR. RETURN(RESULT IN AC-MQ(FPP AC))
	.DEFIN	FOPDEF,NAME,SUBR,INST
	.IFDEF	%FPP
	.DEFIN	NAME
	INST
	.ENDM
	.ENDC
	.IFUND	%FPP
	.GLOBL	SUBR
	.DEFIN	NAME
	JMS*	SUBR
	.ENDM
	.ENDC
	.ENDM
	.GLOBL	.BI,.BJ,.BK
	FOPDEF	ELD%,.JG,713100
	FOPDEF	EMP%,.JK,711500
	FOPDEF	EST%,.JH,713700
.BI	CAL	0		/I**J
	.IFUND %FPP
	LRSS	22	/MAKE D.I.
	DAC	B1
	.ENDC
	.IFDEF %FPP
	.GLOBL	.ZC
	JMS*	.ZC
	.ENDC
	LAC	.BI
	CLL!CML		/INDICATE D.I. EXPONENT
	JMP	.BCOMN
/
.BK	CAL	0		/J**I
	CLL		/INDICATE INTEGER EXP
	.IFUND %FPP
	DAC	B1
	.ENDC
	LAC	.BK
	JMP	.BCOMN
/
.BJ	CAL	0			/J**J
	CLL!CML		/INDICATE D.I. EXPONENT
	.IFUND %FPP
	DAC	B1
	.ENDC
	LAC	.BJ
.BCOMN	DAC	R	/SAVE RETURN ADDRESS
	LAC*	R
	DAC	A	/COMPUTE ARGUMENT ADDRESS
	SPA
	LAC*	A
	DAC	A
	.IFUND %FPP
	LACQ		/GET LOW ORDER BASE
	DAC	B2
	.ENDC
	.IFDEF %FPP
	EST%
	.DSA	B1
	.ENDC
	DZM	R1
	DZM	R2	/INITIALIZE RESULT TO 0
	LAC*	A
	ISZ	R
	DAC	E1	/SAVE HIGH ORDER EXP
	SPA!CLA		/IF EXP<0,
	JMP	.BRETN	/ANS=0
	ISZ	A
	SZL		/AVOID GETTING 2ND WORD IF NOT D.I.-MAY CAUSE NEXM
	LAC*	A
	LMQ		/LOW ORDER EXP TO MQ
	LAC	E1
	SNL		/IS EXPONENT A DOUBLE INTEGER?
	LRSS	22	/NO, MAKE IT ONE
	DAC	E1
	LACQ
	DAC	E2	/RESAVE EXPONENT AS DOUBLE INTEGER
	ISZ	R2	/INITIALIZE RESULT TO 1
.BLOOP	LAC	E1
	RCR
	DAC	E1
	LAC	E2
	RAR
	DAC	E2	/SHIFT EXPONENT RIGHT 1
	SNL
	JMP	.BTEST	/LOW BIT ZERO - DON'T MULTIPLY RESULT
	ELD%
	.DSA	R1
	EMP%
	.DSA	B1
	EST%
	.DSA	R1	/RESULT*BASE=RESULT
.BTEST	LAC	E1
	SNA
	LAC	E2
	SNA!CLA		/IF BOTH HALVES OF THE EXPONENT ARE ZERO,
	JMP	.BRETN	/ITS TIME TO RETURN
	ELD%
	.DSA	B1
	EMP%
	.DSA	B1
	EST%
	.DSA	B1	/BASE*BASE=BASE
	JMP	.BLOOP	/KEEP GOING
.BRETN	ELD%
	.DSA	R1
	JMP*	R	/RETURN WITH RESULT IN CORRECT AC
/
R	0
R1	0
R2	0
B1	0
B2	0
E1	0
E2	0
A	0
	.END
