OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      99  HISTORY		; Detailed current edit history

   (3)     108  DECLARATIONS

   (4)     144  OTS$POWDD - DOUBLE to DOUBLE giving DOUBLE resu

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   1

0-07                                                                                                                             (1)



                                     0000     1 	.TITLE	OTS$POWDD - DOUBLE PRECISION ** DOUBLE PRECISION power routine

                                     0000     2 	.IDENT	/0-07/		; File: OTSPOWDD.MAR

                                     0000     3 

                                     0000     4 ;

                                     0000     5 ; Copyright (C) 1977

                                     0000     6 ; Digital Equipment Corporation, Maynard, Massachusetts 01754

                                     0000     7 ;

                                     0000     8 ; This software is furnished under a license for use only on a single

                                     0000     9 ; computer  system  and  may be copied only with the inclusion of the

                                     0000    10 ; above copyright notice. This software, or any other copies thereof,

                                     0000    11 ; may not be provided or otherwise made available to any other person

                                     0000    12 ; except for use on such system and to one who agree to these license 

                                     0000    13 ; terms.  Title to  and  ownership of the software shall at all times 

                                     0000    14 ; remain in DEC.

                                     0000    15 ;

                                     0000    16 ; The information in the software is subject to change without notice

                                     0000    17 ; and should  not  be construed  as a commitment by Digital Equipment 

                                     0000    18 ; Corporation.

                                     0000    19 ;

                                     0000    20 ; DEC assumes  no  responsibility  for the use or  reliability of its

                                     0000    21 ; software on equipment which is not supplied by DEC.

                                     0000    22 ;

                                     0000    23 ;

                                     0000    24 ; FACILITY: Language support library - user callable

                                     0000    25 ;++

                                     0000    26 ; ABSTRACT:

                                     0000    27 ;

                                     0000    28 ;	1)  Double base to double power.

                                     0000    29 ;	2)  Floating base to double power.

                                     0000    30 ;	3)  Double base to floating power.

                                     0000    31 ;

                                     0000    32 ;	Floating overflow can occur

                                     0000    33 ;	Undefined exponentiation can occur if:

                                     0000    34 ;		1)  Negative base

                                     0000    35 ;		2)  0 base and power is 0 or negative.

                                     0000    36 ;

                                     0000    37 ;

                                     0000    38 ;

                                     0000    39 ;--

                                     0000    40 ;

                                     0000    41 ; VERSION: 0

                                     0000    42 ;

                                     0000    43 ; HISTORY:

                                     0000    44 ;

                                     0000    45 ; AUTHOR:

                                     0000    46 ;	Jonathan Taylor, 24-Jun-77: Version 0

                                     0000    47 ;

                                     0000    48 ; MODIFIED BY:

                                     0000    49 ;

                                     0000    50 ;

                                     0000    51 ;

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   2

0-07            HISTORY  ; Detailed current edit history                                                                         (2)



                                     0000    53 	.SBTTL	HISTORY		; Detailed current edit history

                                     0000    54 

                                     0000    55 

                                     0000    56 ; Edit history for Version 0 of OTS$POWDD

                                     0000    57 ;

                                     0000    58 ; 0-06	- Change FOR$FLAG_JACKET to MTH$FLAG_JACKET.  TNH 17-July-78

                                     0000    59 ; 0-07	- Change the other two FOR$FLAG_JACKETs to MTH$FLAG_JACKET.

                                     0000    60 ;	  DGP 18-Jul-78

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   3

0-07            DECLARATIONS                                                                                                     (3)



                                     0000    62 	.SBTTL	DECLARATIONS

                                     0000    63 

                                     0000    64 ;

                                     0000    65 ; INCLUDE FILES:

                                     0000    66 ;

                                     0000    67 ;	OERR.MAR			; OTS error codes

                                     0000    68 

                                     0000    69 ;

                                     0000    70 ; EXTERNAL SYMBOLS:

                                     0000    71 ;

                                     0000    72 	.GLOBL	MTH$$SIGNAL		; Math error routine

                                     0000    73 	.GLOBL	MTH$DLOG_R8		; Double logarithm

                                     0000    74 	.GLOBL	MTH$DEXP_R7		; Double exponential

                                     0000    75 

                                     0000    76 ;

                                     0000    77 ; MACROS:

                                     0000    78 ;

                                     0000    79 

                                     0000    80 ;

                                     0000    81 ; EQUATED SYMBOLS:

                                     0000    82 ;

                           00000004  0000    83 	base	= 4			; base input formal - by-value

                           0000000C  0000    84 	exp	= 12			; exponent input formal - by-value

                           00000008  0000    85 	fexp	= 8			; exponent when base is floating

                                     0000    86 					; by-value

                                     0000    87 

                                     0000    88 ;

                                     0000    89 ; OWN STORAGE:

                                     0000    90 ;

                                     0000    91 

                                     0000    92 ;

                                     0000    93 ; PSECT DECLARATIONS:

                                     0000    94 ;

                                 00000000    95 	.PSECT	OTS$CODE	PIC,SHR,LONG,EXE,NOWRT

                                     0000    96 					; program section for OTS$ code

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   4

0-07            OTS$POWDD - DOUBLE to DOUBLE giving DOUBLE resu                                                                  (4)



                                     0000    98 	.SBTTL	OTS$POWDD - DOUBLE to DOUBLE giving DOUBLE result

                                     0000    99 

                                     0000   100 ;++

                                     0000   101 ; FUNCTIONAL DESCRIPTION:

                                     0000   102 ;

                                     0000   103 ;	OTS$POWDR - DOUBLE result = DOUBLE base ** FLOATING exponent

                                     0000   104 ;	OTS$POWRD - DOUBLE result = FLOATING base ** DOUBLE exponent

                                     0000   105 ;	OTS$POWDD - DOUBLE result = DOUBLE base ** DOUBLE exponent

                                     0000   106 ;

                                     0000   107 ;	The DOUBLE result is given by:

                                     0000   108 ;

                                     0000   109 ;	base	exponent	result

                                     0000   110 ;	----	--------	------

                                     0000   111 ;

                                     0000   112 ;	= 0	> 0		0.0

                                     0000   113 ;	= 0	= 0		Undefined Exponentiation

                                     0000   114 ;	= 0	< 0		Undefined Exponentiation

                                     0000   115 ;

                                     0000   116 ;	< 0	any		Undefined Exponentiation

                                     0000   117 ;

                                     0000   118 ;	> 0	> 0		EXP(exp * LOG(base))

                                     0000   119 ;	> 0	= 0		1.0

                                     0000   120 ;	> 0	< 0		EXP(exp * LOG(base))

                                     0000   121 ;

                                     0000   122 ;

                                     0000   123 ;	Floating Overflow can occur.

                                     0000   124 ;	Undefined Exponentiation can occur if:

                                     0000   125 ;		1)  base is 0 and exponent is 0 or negative

                                     0000   126 ;		2)  base is negative

                                     0000   127 ;

                                     0000   128 ; CALLING SEQUENCE:

                                     0000   129 ;

                                     0000   130 ;	power.wd.v = OTS$POWDR (base.rd.v, exponent.rf.v)

                                     0000   131 ;	power.wd.v = OTS$POWRD (base.rf.v, exponent.rd.v)

                                     0000   132 ;	power.wd.v = OTS$POWDD (base.rd.v, exponent.rd.v)

                                     0000   133 ;

                                     0000   134 ; INPUT PARAMETERS:

                                     0000   135 ;	base and exponent parameters are call by value

                                     0000   136 ;

                                     0000   137 ; IMPLICIT INPUTS:

                                     0000   138 ;	none

                                     0000   139 ;

                                     0000   140 ; OUTPUT PARAMETERS:

                                     0000   141 ;	none

                                     0000   142 ;

                                     0000   143 ; IMPLICIT OUTPUTS:

                                     0000   144 ;	none

                                     0000   145 ;

                                     0000   146 ; FUNCTIONAL VALUE:

                                     0000   147 ;	OTS$POWDR - DOUBLE base ** FLOATING power

                                     0000   148 ;	OTS$POWRD - FLOATING base ** DOUBLE power

                                     0000   149 ;	OTS$POWDD - DOUBLE base ** DOUBLE power

                                     0000   150 ;

                                     0000   151 ; SIDE EFFECTS:

                                     0000   152 ;

                                     0000   153 ;	SIGNALs SS$_ARITH with floating overflow hardware code if

                                     0000   154 ;	floating overflow.

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   5

0-07            OTS$POWDD - DOUBLE to DOUBLE giving DOUBLE resu                                                                  (4)



                                     0000   155 ;	SIGNALs MTH$_UNDEXP (82 = ' UNDEFINED EXPONENTIATION') if

                                     0000   156 ;		1)  base is 0 and exponent is 0 or negative

                                     0000   157 ;		2)  base is negative

                                     0000   158 ;

                                     0000   159 ;

                                     0000   160 ;--

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   6

0-07            OTS$POWDD - DOUBLE to DOUBLE giving DOUBLE resu                                                                  (5)



                               41FC' 0000   162 	.ENTRY	OTS$POWDR, ^M<IV,R2,R3,R4,R5,R6,R7,R8>	; enable integer overflow

                                     0002   163 	MTH$FLAG_JACKET			; establish math error handler

                                     0002      

            6D       0000'CF     3E  0002       	MOVAW	W^MTH$$JACKET_HND, (FP)

                                     0007       					; set handler address to jacket

                                     0007       					; handler

                                     0007       

            52         0C AC     56  0007   164 	CVTFD	exp(AP), R2		; convert FLOATING exponent to DOUBLE

                          1C     11  000B   165 	BRB	COMDB			; and merge for common DOUBLE base

                                     000D   166 

                                     000D   167 

                                     000D   168 

                                     000D   169 

                                     000D   170 

                                     000D   171 

                               41FC' 000D   172 	.ENTRY	OTS$POWRD, ^M<IV,R2,R3,R4,R5,R6,R7,R8> ; enable integer overflow

                                     000F   173 	MTH$FLAG_JACKET			; establish math error handler

                                     000F      

            6D       0000'CF     3E  000F       	MOVAW	W^MTH$$JACKET_HND, (FP)

                                     0014       					; set handler address to jacket

                                     0014       					; handler

                                     0014       

            52         08 AC     70  0014   174 	MOVD	fexp(AP), R2		; R2/R3 = DOUBLE exponent

            50         04 AC     56  0018   175 	CVTFD	base(AP), R0		; R0/R1 = converted FLOATING base

                          0F     11  001C   176 	BRB	COM			; and merge with common code

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   7

0-07            OTS$POWDD - DOUBLE to DOUBLE giving DOUBLE resu                                                                  (6)



                               41FC' 001E   178 	.ENTRY	OTS$POWDD, ^M<IV,R2,R3,R4,R5,R6,R7,R8> ; enable integer overflow

                                     0020   179 	MTH$FLAG_JACKET			; establish math error handler

                                     0020      

            6D       0000'CF     3E  0020       	MOVAW	W^MTH$$JACKET_HND, (FP)

                                     0025       					; set handler address to jacket

                                     0025       					; handler

                                     0025       

            52         0C AC     70  0025   180 	MOVD	exp(AP), R2		; R2/R3 = DOUBLE exponent

                                     0029   181 COMDB:

            50         04 AC     70  0029   182 	MOVD	base(AP), R0		; R0/R1 = DOUBLE base

                                     002D   183 COM:

                          1D     13  002D   184 	BEQL	ZERO			; special case 0 ** n

                          21     19  002F   185 	BLSS	ERR			; negative base is an error

                          52     73  0031   186 	TSTD	R2			; test the exponent

                          13     13  0033   187 	BEQL	ONE			; special case n ** 0

            7E            52     70  0035   188 	MOVD	R2, -(SP)		; save exponent (R2/R3) across call

                 00000000'EF     16  0038   189 	JSB	MTH$DLOG_R8		; R0/R1 = LOG(base)

            50            8E     64  003E   190 	MULD	(SP)+, R0		; R0/R1 = exp * LOG(base)

                 00000000'EF     16  0041   191 	JSB	MTH$DEXP_R7		; R0/R1 = EXP(exp * LOG(base))

                                 04  0047   192 	RET				; function value returned in R0/R1

                                     0048   193 

                                     0048   194 ONE:

            50            08     70  0048   195 	MOVD	#1, R0			; answer is one

                                 04  004B   196 	RET				; returned in R0/R1

                                     004C   197 

                                     004C   198 ZERO:

                          50     7C  004C   199 	CLRD	R0			; answer is zero

                          52     73  004E   200 	TSTD	R2			; test the exponent (R2/R3)

                          0D     14  0050   201 	BGTR	RETURN			; return if positive exponent

                                     0052   202 ERR:

            01            0F     79  0052   203 	ASHQ	#15, #1, R0		; R0/R1 = undefined operand

                          50         0055       

            7E         52 8F     9A  0056   204 	MOVZBL	#MTH__UNDEXP, -(SP)	; FORTRAN error number

       0000'CF            01     FB  005A   205 	CALLS	#1, W^MTH$$SIGNAL	; convert to 32-bit condition code

                                     005F   206 					; and SIGNAL MTH$UNDEXP

                                     005F   207 RETURN:

                                 04  005F   208 	RET				; return function value in R0/R1

                                     0060   209 

                                     0060   210 	.END

OTS$POWDD       - DOUBLE PRECISION ** DOUBLE PRECISION power ro  21-AUG-1978 19:09:50   VAX-11 MACRO X0.3-11               Page   8

SYMBOL TABLE                                                                                                                     (6)



BASE           = 00000004            

COM              0000002D R     02   

COMDB            00000029 R     02   

ERR              00000052 R     02   

EXP            = 0000000C            

FEXP           = 00000008            

FOR$K_ERR_PREFX= 00000018            

MTH$$JACKET_HND  ********   X   02   

MTH$$SIGNAL      ********  GX   01   

MTH$DEXP_R7      ********  GX   01   

MTH$DLOG_R8      ********  GX   01   

MTH$K_ERR_PREFX= 00000016            

MTH__FLOOVEMAT = 00000058            

MTH__FLOUNDMAT = 00000059            

MTH__INVARG    = 00000051            

MTH__LOGZERNEG = 00000053            

MTH__SINSIGLOS = 00000057            

MTH__SQUROONEG = 00000054            

MTH__UNDEXP    = 00000052            

MTH__WRONUMARG = 00000050            

ONE              00000048 R     02   

OTS$POWDD        0000001E RG    02   

OTS$POWDR        00000000 RG    02   

OTS$POWRD        0000000D RG    02   

RETURN           0000005F R     02   

ZERO             0000004C R     02   





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

OTS$CODE         00000060      02       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

27798. BYTES LEFT IN FREE MEMORY POOL.

OBJ$:OTSPOWDD,LIS$:OTSPOWDD/-SP=LIB$:S/ML,SRC$:P,OTSPOWDD

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 3 INTER. FILE WRITES. 

