ASSEMBLY LISTING OF SEGMENT >spec>install>1110>square_root_.alm ASSEMBLED ON: 11/11/89 0940.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 square_root_ 7 " Modification history: 8 " Written by H. Hoover, M. Mabey, and B. Wong, April 1985, 9 " based on the GCOS routine '7nbb'. 10 " 11 " Function: Approximate to single 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 BFP,0 000002 26 equ HFP,2 000000 27 equ root_m,0 000002 28 equ x,2 000004 29 equ m,4 000006 30 equ e,6 31 000200 32 bool P0.25H,000200 " yields HFP +0.25 under 'du' modification 002200 33 bool P4.0H,002200 " yields HFP +4.0 under 'du' modification 34 000045 35 segdef square_root_,hfp_square_root_ 36 37 000000 38 square_root_: 000000 aa 400000 4750 03 39 fad =0.0,du " normalize input arg 000001 aa 3 00000 6001 00 40 tze pr3|0 " if x = 0 return (0) 000002 0a 000010 6050 00 41 tpl calc_square_root " if x < 0: 000003 aa 000000 5130 00 42 fneg 0 " x = -x 000004 aa 2 00002 4551 00 43 fst pr2|x 000005 aa 000015 2360 07 44 ldq 13,dl 000006 4a 4 00010 7001 20 45 tsx0 |[call_math_error_] 000007 aa 2 00002 4311 00 46 fld pr2|x " calculate sqrt (abs(x)) 47 000010 48 calc_square_root: 000010 aa 2 00002 4551 00 49 fst pr2|x " store EA := input arg 000011 aa 2 00002 2201 00 50 ldx0 pr2|x " X0 := addr (x) -> expon 51 " m = x 000012 aa 000000 4110 03 52 lde =0b25,du " addr (m) -> expon = 0 000013 aa 002000 3000 03 53 canx0 =1b25,du " calculate mod (e, 2) 000014 aa 000002 6000 04 54 tze 2,ic " if mod (e, 2) = 1: 000015 aa 776000 4110 03 55 lde =-1b25,du " EA := m = .5*m 000016 aa 2 00002 2361 00 56 ldq pr2|x " Q := 8/expon,28/garbage 000017 aa 000034 7320 00 57 qrs 28 " Q := 28/0,8/expon 000020 aa 000001 0760 07 58 adq =1,dl " calculate e+1 000021 aa 000001 7320 00 59 qrs 1 " calculate divide (e+1, 2, 7) 000022 aa 000034 7360 00 60 qls 28 " position result in exponent field 000023 aa 2 00006 7561 00 61 stq pr2|e " store Q := e = divide (e+1, 2, 7) 000024 0a 000140 2360 00 62 ldq =0 " clear Q 000025 aa 2 00004 4571 00 63 dfst pr2|m " store EAQ := m 000026 0a 000130 4610 00 64 fmp p2 " calculate root_m = p(m) 000027 0a 000124 4750 00 65 fad p1 000030 aa 2 00004 4611 00 66 fmp pr2|m 000031 0a 000120 4750 00 67 fad p0 68 000032 aa 2 00000 4551 00 69 fst pr2|root_m 000033 aa 2 00004 5251 00 70 fdi pr2|m " calculate root_m = .5 * (root_m + m/root_m) 000034 aa 2 00000 4751 00 71 fad pr2|root_m 000035 aa 000400 4610 03 72 fmp =0.5,du 73 000036 aa 2 00000 4571 00 74 dfst pr2|root_m " calculate root_m + float (m, 63)/root_m 000037 aa 2 00004 5271 00 75 dfdi pr2|m 000040 aa 2 00000 4771 00 76 dfad pr2|root_m 000041 aa 776000 4150 03 77 ade =-1b25,du " root_m = .5 * (root_m + float (m, 63)/root_m) 78 " root_x = root_m 000042 aa 2 00006 4151 00 79 ade pr2|e " calculate addr (root_x) -> expon = 80 " addr (root_x) -> expon + divide (e+1, 2, 7) 000043 aa 000000 4710 00 81 frd 0 000044 aa 3 00000 7101 00 82 tra pr3|0 " return (root_x) 83 000045 84 hfp_square_root_: 000045 aa 400000 4750 03 85 fad =0.0,du " normalize input arg 000046 aa 3 00000 6001 00 86 tze pr3|0 " if x = 0 return (0) 000047 0a 000055 6050 00 87 tpl hfp_calc_square_root 88 " if x < 0: 000050 aa 000000 5130 00 89 fneg 0 " x = -x 000051 aa 2 00002 4551 00 90 fst pr2|x 000052 aa 000015 2360 07 91 ldq 13,dl 000053 4a 4 00010 7001 20 92 tsx0 |[call_math_error_] 000054 aa 2 00002 4311 00 93 fld pr2|x " calculate sqrt (abs(x)) 94 000055 95 hfp_calc_square_root: 000055 aa 2 00002 4551 00 96 fst pr2|x " store EA := input arg 000056 aa 2 00002 2201 00 97 ldx0 pr2|x " X0 := addr (x) -> expon 98 " m = x 000057 aa 000000 4110 03 99 lde =0b25,du " addr (m) -> expon = 0 000060 aa 000000 6210 00 100 eax1 0 " scale = 0.5 000061 aa 000200 5150 03 101 fcmp P0.25H,du 000062 aa 000003 6050 04 102 tpl 3,ic " if m >= .25: scale = 0.5 000063 aa 000002 6210 00 103 eax1 2 " else: scale = 0.25 000064 aa 002200 4610 03 104 fmp P4.0H,du " EA := m = 4*m 000065 aa 002000 3000 03 105 canx0 =1b25,du " calculate mod (e, 2) 000066 aa 000002 6000 04 106 tze 2,ic " if mod (e, 2) = 1: 000067 aa 000001 0610 03 107 adx1 =1,du " scale = 0.25*scale 000070 aa 2 00002 2361 00 108 ldq pr2|x " Q := 8/expon,28/garbage 000071 aa 000034 7320 00 109 qrs 28 " Q := 28/0,8/expon 000072 aa 000001 0760 07 110 adq =1,dl " calculate e+1 000073 aa 000001 7320 00 111 qrs 1 " calculate divide (e+1, 2, 7) 000074 aa 000034 7360 00 112 qls 28 " position result in exponent field 000075 aa 2 00006 7561 00 113 stq pr2|e " store Q := e = divide (e+1, 2, 7) 000076 0a 000140 2360 00 114 ldq =0 " clear Q 000077 aa 2 00004 4571 00 115 dfst pr2|m " store EAQ := m 000100 0a 000132 4610 00 116 fmp hfp_p2 " calculate root_m = p(m) 000101 0a 000126 4750 00 117 fad hfp_p1 000102 aa 2 00004 4611 00 118 fmp pr2|m 000103 0a 000122 4750 00 119 fad hfp_p0 120 000104 aa 2 00000 4551 00 121 fst pr2|root_m 000105 aa 2 00004 5251 00 122 fdi pr2|m " calculate root_m = .5 * (root_m + m/root_m) 000106 aa 2 00000 4751 00 123 fad pr2|root_m 000107 aa 000400 4610 03 124 fmp =0.5,du 125 000110 aa 2 00000 4571 00 126 dfst pr2|root_m " calculate root_m + float (m, 63)/root_m 000111 aa 2 00004 5271 00 127 dfdi pr2|m 000112 aa 2 00000 4771 00 128 dfad pr2|root_m 000113 0a 000134 4610 11 129 fmp scale,x1 " root_m = scale * (root_m + float (m, 63)/root_m) 130 " root_x = root_m 000114 aa 2 00006 4151 00 131 ade pr2|e " calculate addr (root_x) -> expon = 132 " addr (root_x) -> expon + divide (e+1, 2, 7) 000115 aa 000000 4710 00 133 frd 0 000116 aa 3 00000 7101 00 134 tra pr3|0 " return (root_x) 135 000117 aa 000000 0110 03 136 even 000120 aa 776411 377603 137 p0: dec 2.5927688d-1 000121 aa 406536 706351 000122 aa 000204 577702 138 hfp_p0: oct 000204577702,000000000000 000123 aa 000000 000000 000124 aa 002415 257502 139 p1: dec 1.0521212d0 000125 aa 413332 156142 000126 aa 002041 525750 140 hfp_p1: oct 002041525750,000000000000 000127 aa 000000 000000 000130 aa 777274 054062 141 p2: dec -3.1632214d-1 000131 aa 066300 621036 000132 aa 001536 026031 142 hfp_p2: oct 001536026031,000000000000 000133 aa 000000 000000 000134 aa 000400 000000 143 scale: oct 000400000000 " 0.5 000135 aa 000100 000000 144 oct 000100000000 " 0.25*0.5 = 0.125 000136 aa 000200 000000 145 oct 000200000000 " 0.25 000137 aa 000040 000000 146 oct 000040000000 " 0.25*0.25 = 0.0625 147 148 end LITERALS 000140 aa 000000 000000 NAME DEFINITIONS FOR ENTRY POINTS AND SEGDEFS 000141 5a 000003 000000 000142 5a 000040 600000 000143 aa 000000 000000 000144 55 000012 000002 000145 5a 000002 400003 000146 55 000006 000012 000147 aa 014 163 161 165 000150 aa 141 162 145 137 000151 aa 162 157 157 164 000152 aa 137 000 000 000 000153 55 000022 000003 000154 0a 000045 400000 000155 55 000015 000003 000156 aa 020 150 146 160 hfp_square_root_ 000157 aa 137 163 161 165 000160 aa 141 162 145 137 000161 aa 162 157 157 164 000162 aa 137 000 000 000 000163 55 000031 000012 000164 0a 000000 400000 000165 55 000025 000003 000166 aa 014 163 161 165 square_root_ 000167 aa 141 162 145 137 000170 aa 162 157 157 164 000171 aa 137 000 000 000 000172 55 000002 000022 000173 6a 000000 400002 000174 55 000034 000003 000175 aa 014 163 171 155 symbol_table 000176 aa 142 157 154 137 000177 aa 164 141 142 154 000200 aa 145 000 000 000 DEFINITIONS HASH TABLE 000201 aa 000000 000015 000202 5a 000022 000000 000203 aa 000000 000000 000204 aa 000000 000000 000205 aa 000000 000000 000206 aa 000000 000000 000207 aa 000000 000000 000210 5a 000031 000000 000211 aa 000000 000000 000212 aa 000000 000000 000213 5a 000012 000000 000214 aa 000000 000000 000215 aa 000000 000000 000216 aa 000000 000000 EXTERNAL NAMES 000217 aa 020 143 141 154 call_math_error_ 000220 aa 154 137 155 141 000221 aa 164 150 137 145 000222 aa 162 162 157 162 000223 aa 137 000 000 000 NO TRAP POINTER WORDS TYPE PAIR BLOCKS 000224 aa 000004 000000 000225 55 000056 000056 000226 aa 000001 000000 000227 aa 000000 000000 INTERNAL EXPRESSION WORDS 000230 5a 000063 000000 000231 aa 000000 000000 LINKAGE INFORMATION 000000 aa 000000 000000 000001 0a 000141 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 000067 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 251272 122706 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 000137 000020 aa 000000 000103 000021 aa 000120 000114 000022 aa 000131 000103 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 000043 000067 aa 175453 020051 000070 aa 000000 117547 000071 aa 176666 000000 000072 aa 076163 160145 >spec>install>1110>square_root_.alm 000073 aa 143076 151156 000074 aa 163164 141154 000075 aa 154076 061061 000076 aa 061060 076163 000077 aa 161165 141162 000100 aa 145137 162157 000101 aa 157164 137056 000102 aa 141154 155040 MULTICS ASSEMBLY CROSS REFERENCE LISTING Value Symbol Source file Line number 0 BFP square_root_: 25. 10 calc_square_root square_root_: 41, 48. call_math_error_ square_root_: 45, 92. 6 e square_root_: 30, 61, 79, 113, 131. 2 HFP square_root_: 26. 55 hfp_calc_square_root square_root_: 87, 95. 122 hfp_p0 square_root_: 119, 138. 126 hfp_p1 square_root_: 117, 140. 132 hfp_p2 square_root_: 116, 142. 45 hfp_square_root_ square_root_: 35, 84. 4 m square_root_: 29, 63, 66, 70, 75, 115, 118, 122, 127. 120 p0 square_root_: 67, 137. 200 P0.25H square_root_: 32, 101. 124 p1 square_root_: 65, 139. 130 p2 square_root_: 64, 141. 2200 P4.0H square_root_: 33, 104. 0 root_m square_root_: 27, 69, 71, 74, 76, 121, 123, 126, 128. 134 scale square_root_: 129, 143. 0 square_root_ square_root_: 35, 38. 2 x square_root_: 28, 43, 46, 49, 50, 56, 90, 93, 96, 97, 108. 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