ASSEMBLY LISTING OF SEGMENT >spec>install>1110>double_square_root_.alm ASSEMBLED ON: 11/11/89 0945.3 mst Sat OPTIONS USED: -target l68 list symbols ASSEMBLED BY: ALM Version 8.14 March 1989 ASSEMBLER CREATED: 06/09/89 1002.3 mst Fri 1 " ****************************************** 2 " * * 3 " * Copyright, (C) Honeywell Limited, 1985 * 4 " * * 5 " ****************************************** 000000 6 name double_square_root_ 7 " Modification history: 8 " Written by H. Hoover, M. Mabey, and B. Wong, April 1985, 9 " based on GCOS routine '7nau'. 10 " 11 " Function: Approximate to double precision the square root of a number. 12 " 13 " Entry: through the appropriately named entry point with: 14 " EAQ = the number whose square root is desired. 15 " PR2 = the address of an 8 word, even-word aligned scratch area. 16 " PR3 = the return address. 17 " 18 " Exit: EAQ = the desired square root. 19 " 20 " Uses: X0, X1 21 " X0 = temporary storage for exponent of input argument 22 " and saves a return address from call_math_error_ 23 " X1 = index to scale table 24 000000 25 equ root_m,0 000002 26 equ x,2 000004 27 equ m,4 000006 28 equ e,6 29 002200 30 bool P4.0H,002200 " yields HFP +4.0 under 'du' modification 31 000000 32 segdef double_square_root_,hfp_double_square_root_ 33 34 000000 35 hfp_double_square_root_: 000000 aa 400000 4750 03 36 fad =0.0,du " normalize input arg 000001 aa 3 00000 6001 00 37 tze pr3|0 " if x = 0 return (0) 000002 0a 000010 6050 00 38 tpl hfp_calc_square_root " if x < 0: 000003 aa 000000 5130 00 39 fneg 0 " x = -x 000004 aa 2 00002 4571 00 40 dfst pr2|x 000005 aa 000026 2360 07 41 ldq 22,dl 000006 4a 4 00010 7001 20 42 tsx0 |[call_math_error_] 000007 aa 2 00002 4331 00 43 dfld pr2|x 44 000010 45 hfp_calc_square_root: 000010 aa 2 00002 4571 00 46 dfst pr2|x " store EAQ := input arg 000011 aa 2 00002 2201 00 47 ldx0 pr2|x " X0 := addr (x) -> expon 48 " m = x 000012 aa 000000 4110 03 49 lde =0b25,du " addr (m) -> expon = 0 000013 aa 000000 6210 00 50 eax1 0 " scale = 0.5 000014 0a 000134 5170 00 51 dfcmp one_quarter 000015 aa 000003 6050 04 52 tpl 3,ic " if m >= .25: scale = 0.5 000016 aa 000002 6210 00 53 eax1 2 " else: scale = 0.25 000017 aa 002200 4610 03 54 fmp P4.0H,du " EAQ := m = 4*m 55 000020 aa 002000 3000 03 56 canx0 =1b25,du " calculate mod (e, 2) 000021 aa 000002 6000 04 57 tze 2,ic " if mod (e, 2) = 1: 000022 aa 000001 0610 03 58 adx1 =1,du " scale = 0.25*scale 59 000023 aa 2 00004 4571 00 60 dfst pr2|m " store EAQ := m 000024 aa 2 00002 2361 00 61 ldq pr2|x " Q := 8/expon,28/garbage 000025 aa 000034 7320 00 62 qrs 28 " Q := 28/0,8/expon 000026 aa 000001 0760 07 63 adq =1,dl " calculate e+1 000027 aa 000001 7320 00 64 qrs 1 " calculate divide (e+1, 2, 7) 000030 aa 000034 7360 00 65 qls 28 " position result in exponent field 000031 aa 2 00006 7561 00 66 stq pr2|e " store Q := e = divide (e+1, 2, 7) 000032 aa 2 00004 4331 00 67 dfld pr2|m 000033 0a 000150 4610 00 68 fmp hfp_p2 " calculate root_m_top = p(m) 000034 0a 000144 4750 00 69 fad hfp_p1 000035 aa 2 00004 4611 00 70 fmp pr2|m 000036 0a 000140 4750 00 71 fad hfp_p0 72 000037 aa 2 00000 4551 00 73 fst pr2|root_m 000040 aa 2 00004 5251 00 74 fdi pr2|m " calculate root_m = .5 * (root_m_top + m_top/root_m_top) 000041 aa 2 00000 4751 00 75 fad pr2|root_m 000042 aa 000400 4610 03 76 fmp =0.5,du 77 000043 aa 000000 4730 00 78 dfrd 0 000044 aa 2 00000 4571 00 79 dfst pr2|root_m 000045 aa 2 00004 5271 00 80 dfdi pr2|m " calculate root_m = .5 * (root_m + m/root_m) 000046 aa 2 00000 4771 00 81 dfad pr2|root_m 000047 aa 000400 4610 03 82 fmp =0.5,du 83 000050 aa 000000 4730 00 84 dfrd 0 000051 aa 2 00000 4571 00 85 dfst pr2|root_m " calculate root_m + m/root_m 000052 aa 2 00004 5271 00 86 dfdi pr2|m 000053 aa 2 00000 4771 00 87 dfad pr2|root_m 000054 0a 000152 4610 11 88 fmp scale,x1 " root_m = scale * (root_m + float (m, 63)/root_m) 89 " root_x = root_m 000055 aa 2 00006 4151 00 90 ade pr2|e " calculate addr (root_x) -> expon = 91 " addr (root_x) -> expon + divide (e+1, 2, 7) 000056 aa 000000 4730 00 92 dfrd 0 000057 aa 3 00000 7101 00 93 tra pr3|0 " return (root_x) 94 95 000060 96 double_square_root_: 000060 aa 400000 4750 03 97 fad =0.0,du " normalize input arg 000061 aa 3 00000 6001 00 98 tze pr3|0 " if x = 0 return (0) 000062 0a 000070 6050 00 99 tpl calc_square_root " if x < 0: 000063 aa 000000 5130 00 100 fneg 0 " x = -x 000064 aa 2 00002 4571 00 101 dfst pr2|x 000065 aa 000026 2360 07 102 ldq 22,dl 000066 4a 4 00010 7001 20 103 tsx0 |[call_math_error_] 000067 aa 2 00002 4331 00 104 dfld pr2|x 105 000070 106 calc_square_root: 000070 aa 2 00002 4571 00 107 dfst pr2|x " store EAQ := input arg 000071 aa 2 00002 2201 00 108 ldx0 pr2|x " X0 := addr (x) -> expon 109 " m = x 000072 aa 000000 4110 03 110 lde =0b25,du " addr (m) -> expon = 0 111 000073 aa 002000 3000 03 112 canx0 =1b25,du " calculate mod (e, 2) 000074 aa 000002 6000 04 113 tze 2,ic " if mod (e, 2) = 1: 000075 aa 776000 4110 03 114 lde =-1b25,du " EAQ := m = .5*m 115 000076 aa 2 00004 4571 00 116 dfst pr2|m " store EAQ := m 000077 aa 2 00002 2361 00 117 ldq pr2|x " Q := 8/expon,28/garbage 000100 aa 000034 7320 00 118 qrs 28 " Q := 28/0,8/expon 000101 aa 000001 0760 07 119 adq =1,dl " calculate e+1 000102 aa 000001 7320 00 120 qrs 1 " calculate divide (e+1, 2, 7) 000103 aa 000034 7360 00 121 qls 28 " position result in exponent field 000104 aa 2 00006 7561 00 122 stq pr2|e " store Q := e = divide (e+1, 2, 7) 000105 aa 2 00004 4331 00 123 dfld pr2|m 000106 0a 000146 4610 00 124 fmp p2 " calculate root_m_top = p(m) 000107 0a 000142 4750 00 125 fad p1 000110 aa 2 00004 4611 00 126 fmp pr2|m 000111 0a 000136 4750 00 127 fad p0 128 000112 aa 2 00000 4551 00 129 fst pr2|root_m 000113 aa 2 00004 5251 00 130 fdi pr2|m " calculate root_m = .5 * (root_m_top + m_top/root_m_top) 000114 aa 2 00000 4751 00 131 fad pr2|root_m 000115 aa 000400 4610 03 132 fmp =0.5,du 133 000116 aa 000000 4730 00 134 dfrd 0 000117 aa 2 00000 4571 00 135 dfst pr2|root_m 000120 aa 2 00004 5271 00 136 dfdi pr2|m " calculate root_m = .5 * (root_m + m/root_m) 000121 aa 2 00000 4771 00 137 dfad pr2|root_m 000122 aa 000400 4610 03 138 fmp =0.5,du 139 000123 aa 000000 4730 00 140 dfrd 0 000124 aa 2 00000 4571 00 141 dfst pr2|root_m " calculate root_m + m/root_m 000125 aa 2 00004 5271 00 142 dfdi pr2|m 000126 aa 2 00000 4771 00 143 dfad pr2|root_m 000127 aa 776000 4150 03 144 ade =-1b25,du " root_m = .5 * (root_m + float (m, 63)/root_m) 145 " root_x = root_m 000130 aa 2 00006 4151 00 146 ade pr2|e " calculate addr (root_x) -> expon = 147 " addr (root_x) -> expon + divide (e+1, 2, 7) 000131 aa 000000 4730 00 148 dfrd 0 000132 aa 3 00000 7101 00 149 tra pr3|0 " return (root_x) 150 000133 aa 000000 0110 03 151 even 000134 152 one_quarter: 000134 aa 000200 000000 153 oct 000200000000,000000000000 " 0.25 000135 aa 000000 000000 000136 aa 776411 377603 154 p0: dec 2.5927688d-1 000137 aa 406536 706351 000140 aa 000204 577702 155 hfp_p0: oct 000204577702,000000000000 000141 aa 000000 000000 000142 aa 002415 257502 156 p1: dec 1.0521212d0 000143 aa 413332 156142 000144 aa 002041 525750 157 hfp_p1: oct 002041525750,000000000000 000145 aa 000000 000000 000146 aa 777274 054062 158 p2: dec -3.1632214d-1 000147 aa 066300 621036 000150 aa 001536 026031 159 hfp_p2: oct 001536026031,000000000000 000151 aa 000000 000000 000152 aa 000400 000000 160 scale: oct 000400000000 " 0.5 000153 aa 000100 000000 161 oct 000100000000 " 0.25*0.5 = 0.125 000154 aa 000200 000000 162 oct 000200000000 " 0.25 000155 aa 000040 000000 163 oct 000040000000 " 0.25*0.25 = 0.0625 164 165 end NO LITERALS NAME DEFINITIONS FOR ENTRY POINTS AND SEGDEFS 000156 5a 000003 000000 000157 5a 000043 600000 000160 aa 000000 000000 000161 55 000013 000002 000162 5a 000002 400003 000163 55 000006 000013 000164 aa 023 144 157 165 000165 aa 142 154 145 137 000166 aa 163 161 165 141 000167 aa 162 145 137 162 000170 aa 157 157 164 137 000171 55 000024 000003 000172 0a 000000 400000 000173 55 000016 000003 000174 aa 027 150 146 160 hfp_double_square_root_ 000175 aa 137 144 157 165 000176 aa 142 154 145 137 000177 aa 163 161 165 141 000200 aa 162 145 137 162 000201 aa 157 157 164 137 000202 55 000034 000013 000203 0a 000060 400000 000204 55 000027 000003 000205 aa 023 144 157 165 double_square_root_ 000206 aa 142 154 145 137 000207 aa 163 161 165 141 000210 aa 162 145 137 162 000211 aa 157 157 164 137 000212 55 000002 000024 000213 6a 000000 400002 000214 55 000037 000003 000215 aa 014 163 171 155 symbol_table 000216 aa 142 157 154 137 000217 aa 164 141 142 154 000220 aa 145 000 000 000 DEFINITIONS HASH TABLE 000221 aa 000000 000015 000222 5a 000013 000000 000223 aa 000000 000000 000224 aa 000000 000000 000225 aa 000000 000000 000226 aa 000000 000000 000227 aa 000000 000000 000230 5a 000034 000000 000231 aa 000000 000000 000232 aa 000000 000000 000233 5a 000024 000000 000234 aa 000000 000000 000235 aa 000000 000000 000236 aa 000000 000000 EXTERNAL NAMES 000237 aa 020 143 141 154 call_math_error_ 000240 aa 154 137 155 141 000241 aa 164 150 137 145 000242 aa 162 162 157 162 000243 aa 137 000 000 000 NO TRAP POINTER WORDS TYPE PAIR BLOCKS 000244 aa 000004 000000 000245 55 000061 000061 000246 aa 000001 000000 000247 aa 000000 000000 INTERNAL EXPRESSION WORDS 000250 5a 000066 000000 000251 aa 000000 000000 LINKAGE INFORMATION 000000 aa 000000 000000 000001 0a 000156 000000 000002 aa 000000 000000 000003 aa 000000 000000 000004 aa 000000 000000 000005 aa 000000 000000 000006 22 000010 000012 000007 a2 000000 000000 000010 9a 777770 0000 46 call_math_error_|call_math_error_ 000011 5a 000072 0000 00 SYMBOL INFORMATION SYMBOL TABLE HEADER 000000 aa 000000 000001 000001 aa 163171 155142 000002 aa 164162 145145 000003 aa 000000 000010 000004 aa 000000 117244 000005 aa 361023 525721 000006 aa 000000 117547 000007 aa 253457 755112 000010 aa 141154 155040 000011 aa 040040 040040 000012 aa 000024 000040 000013 aa 000034 000040 000014 aa 000044 000100 000015 aa 000002 000002 000016 aa 000064 000000 000017 aa 000000 000142 000020 aa 000000 000105 000021 aa 000123 000117 000022 aa 000134 000105 000023 aa 000064 000000 000024 aa 101114 115040 000025 aa 126145 162163 000026 aa 151157 156040 000027 aa 070056 061064 000030 aa 040115 141162 000031 aa 143150 040061 000032 aa 071070 071040 000033 aa 040040 040040 000034 aa 110151 162156 000035 aa 145151 163145 000036 aa 156056 123171 000037 aa 163115 141151 000040 aa 156164 056141 000041 aa 040040 040040 000042 aa 040040 040040 000043 aa 040040 040040 000044 aa 055164 141162 000045 aa 147145 164040 000046 aa 154066 070040 000047 aa 040040 040040 000050 aa 040040 040040 000051 aa 040040 040040 000052 aa 040040 040040 000053 aa 040040 040040 000054 aa 040040 040040 000055 aa 040040 040040 000056 aa 040154 151163 000057 aa 164040 163171 000060 aa 155142 157154 000061 aa 163040 040040 000062 aa 040040 040040 000063 aa 040040 040040 000064 aa 000000 000001 000065 aa 000000 000001 000066 aa 000072 000052 000067 aa 175453 020013 000070 aa 000000 117547 000071 aa 176725 200000 000072 aa 076163 160145 >spec>install>1110>double_square_root_.alm 000073 aa 143076 151156 000074 aa 163164 141154 000075 aa 154076 061061 000076 aa 061060 076144 000077 aa 157165 142154 000100 aa 145137 163161 000101 aa 165141 162145 000102 aa 137162 157157 000103 aa 164137 056141 000104 aa 154155 040040 MULTICS ASSEMBLY CROSS REFERENCE LISTING Value Symbol Source file Line number 70 calc_square_root double_square_root_: 99, 106. call_math_error_ double_square_root_: 42, 103. 60 double_square_root_ double_square_root_: 32, 96. 6 e double_square_root_: 28, 66, 90, 122, 146. 10 hfp_calc_square_root double_square_root_: 38, 45. 0 hfp_double_square_root_ double_square_root_: 32, 35. 140 hfp_p0 double_square_root_: 71, 155. 144 hfp_p1 double_square_root_: 69, 157. 150 hfp_p2 double_square_root_: 68, 159. 4 m double_square_root_: 27, 60, 67, 70, 74, 80, 86, 116, 123, 126, 130, 136, 142. 134 one_quarter double_square_root_: 51, 152. 136 p0 double_square_root_: 127, 154. 142 p1 double_square_root_: 125, 156. 146 p2 double_square_root_: 124, 158. 2200 P4.0H double_square_root_: 30, 54. 0 root_m double_square_root_: 25, 73, 75, 79, 81, 85, 87, 129, 131, 135, 137, 141, 143. 152 scale double_square_root_: 88, 160. 2 x double_square_root_: 26, 40, 43, 46, 47, 61, 101, 104, 107, 108, 117. NO FATAL ERRORS ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved