COMPILATION LISTING OF SEGMENT flt_bin_sort_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1805.7 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 flt_bin_sort_: proc (v, x, n); 12 13 /* Singleton sort - from Max Smith */ 14 15 dcl v (*) float bin, /* input array of strings to sort */ 16 x (*) fixed bin, /* index array which will be filled in */ 17 n fixed bin; /* number of items to sort */ 18 19 dcl (i, j, k, l, m) fixed bin, 20 q fixed bin, 21 xi fixed bin, 22 xj fixed bin, 23 (vxi, vxj) float bin, 24 xk fixed bin, 25 vxk float bin, 26 xl fixed bin, 27 xq fixed bin, 28 vxq float bin; 29 30 dcl stacki (18) fixed bin, 31 stackj (18) fixed bin, 32 cut fixed bin int static init (12); 33 34 i, m = 1; 35 j = n; 36 go to test; 37 38 sloop: k = i; 39 l = j; 40 q = divide (i+j, 2, 17, 0); 41 xi = x (i); 42 vxi = v (xi); 43 xj = x (j); 44 vxj = v (xj); 45 xq = x (q); 46 vxq = v (xq); 47 if vxq < vxi then 48 if vxj < vxi then 49 if vxq < vxj then do; /* vxq < vxj < vxi */ 50 x (i) = xq; 51 x (q) = xj; 52 x (j) = xi; 53 vxq = vxj; 54 end; 55 else do; /* vxj <= vxq < vxi */ 56 x (i) = xj; 57 x (j) = xi; 58 end; 59 else do; /* vxq < vxi <= vxj */ 60 x (i) = xq; 61 x (q) = xi; 62 vxq = vxi; 63 end; 64 else if vxj < vxq then 65 if vxi < vxj then do; /* vxi < vxj < vxq */ 66 x (q) = xj; 67 x (j) = xq; 68 vxq = vxj; 69 end; 70 else do; /* vxj <= vxi <= vxq */ 71 x (q) = xi; 72 x (i) = xj; /* warning: x(q) before x(i) so q=i works */ 73 x (j) = xq; 74 vxq = vxi; 75 end; 76 77 /* here, v(x(i)) <= vxq <= v(x(j)) */ 78 79 lloop: l = l - 1; 80 xl = x (l); 81 if v (xl) > vxq then go to lloop; 82 kloop: k = k + 1; 83 xk = x (k); 84 if v (xk) < vxq then go to kloop; 85 86 /* here, v(x(l)) <= vxq <= v(x(k)) */ 87 88 if k <= l then do; 89 x (k) = xl; 90 x (l) = xk; 91 go to lloop; 92 end; 93 if l - i > j - k then do; 94 stacki (m) = k; 95 stackj (m) = j; 96 j = l; 97 end; 98 else do; 99 stacki (m) = i; 100 stackj (m) = l; 101 i = k; 102 end; 103 m = m + 1; 104 105 test: if j-i > cut then go to sloop; 106 if i = 1 then if i < j then go to sloop; 107 do i = i + 1 by 1 while (i <= j); 108 k = i; 109 xk = x (k); 110 vxk = v (xk); 111 bubble: l = k - 1; 112 xl = x (l); 113 if v (xl) <= vxk then go to ok; 114 x (k) = xl; 115 x (l) = xk; 116 k = l; 117 go to bubble; 118 ok: end; 119 m = m - 1; 120 if m = 0 then do; 121 xj=divide(n,2,17,0); 122 do i = 1 to xj; 123 xk= x(i); 124 x(i)=x(n+1-i); 125 x(n+1-i)=xk; 126 end; 127 return; 128 end; 129 i = stacki (m); 130 j = stackj (m); 131 go to test; 132 133 end flt_bin_sort_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1608.8 flt_bin_sort_.pl1 >dumps>old>recomp>flt_bin_sort_.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. cut constant fixed bin(17,0) initial dcl 30 ref 105 i 000100 automatic fixed bin(17,0) dcl 19 set ref 34* 38 40 41 50 56 60 72 93 99 101* 105 106 106 107* 107 107* 108* 122* 123 124 124 125* 129* j 000101 automatic fixed bin(17,0) dcl 19 set ref 35* 39 40 43 52 57 67 73 93 95 96* 105 106 107 130* k 000102 automatic fixed bin(17,0) dcl 19 set ref 38* 82* 82 83 88 89 93 94 101 108* 109 111 114 116* l 000103 automatic fixed bin(17,0) dcl 19 set ref 39* 79* 79 80 88 90 93 96 100 111* 112 115 116 m 000104 automatic fixed bin(17,0) dcl 19 set ref 34* 94 95 99 100 103* 103 119* 119 120 129 130 n parameter fixed bin(17,0) dcl 15 ref 11 35 121 124 125 q 000105 automatic fixed bin(17,0) dcl 19 set ref 40* 45 51 61 66 71 stacki 000117 automatic fixed bin(17,0) array dcl 30 set ref 94* 99* 129 stackj 000141 automatic fixed bin(17,0) array dcl 30 set ref 95* 100* 130 v parameter float bin(27) array dcl 15 ref 11 42 44 46 81 84 110 113 vxi 000110 automatic float bin(27) dcl 19 set ref 42* 47 47 62 64 74 vxj 000111 automatic float bin(27) dcl 19 set ref 44* 47 47 53 64 64 68 vxk 000113 automatic float bin(27) dcl 19 set ref 110* 113 vxq 000116 automatic float bin(27) dcl 19 set ref 46* 47 47 53* 62* 64 68* 74* 81 84 x parameter fixed bin(17,0) array dcl 15 set ref 11 41 43 45 50* 51* 52* 56* 57* 60* 61* 66* 67* 71* 72* 73* 80 83 89* 90* 109 112 114* 115* 123 124* 124 125* xi 000106 automatic fixed bin(17,0) dcl 19 set ref 41* 42 52 57 61 71 xj 000107 automatic fixed bin(17,0) dcl 19 set ref 43* 44 51 56 66 72 121* 122 xk 000112 automatic fixed bin(17,0) dcl 19 set ref 83* 84 90 109* 110 115 123* 125 xl 000114 automatic fixed bin(17,0) dcl 19 set ref 80* 81 89 112* 113 114 xq 000115 automatic fixed bin(17,0) dcl 19 set ref 45* 46 50 60 67 73 NAMES DECLARED BY EXPLICIT CONTEXT. bubble 000371 constant label dcl 111 ref 117 flt_bin_sort_ 000015 constant entry external dcl 11 kloop 000234 constant label dcl 82 ref 84 lloop 000205 constant label dcl 79 ref 81 91 ok 000436 constant label dcl 118 ref 113 sloop 000031 constant label dcl 38 ref 105 106 test 000327 constant label dcl 105 ref 36 131 NAME DECLARED BY CONTEXT OR IMPLICATION. divide builtin function ref 40 121 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 550 560 522 560 Length 720 522 10 124 25 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME flt_bin_sort_ 120 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME flt_bin_sort_ 000100 i flt_bin_sort_ 000101 j flt_bin_sort_ 000102 k flt_bin_sort_ 000103 l flt_bin_sort_ 000104 m flt_bin_sort_ 000105 q flt_bin_sort_ 000106 xi flt_bin_sort_ 000107 xj flt_bin_sort_ 000110 vxi flt_bin_sort_ 000111 vxj flt_bin_sort_ 000112 xk flt_bin_sort_ 000113 vxk flt_bin_sort_ 000114 xl flt_bin_sort_ 000115 xq flt_bin_sort_ 000116 vxq flt_bin_sort_ 000117 stacki flt_bin_sort_ 000141 stackj flt_bin_sort_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return ext_entry_desc NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000011 34 000022 35 000025 36 000030 38 000031 39 000033 40 000035 41 000040 42 000054 43 000065 44 000073 45 000077 46 000105 47 000111 50 000120 51 000123 52 000126 53 000131 54 000133 56 000134 57 000137 58 000142 60 000143 61 000146 62 000151 63 000153 64 000154 66 000161 67 000164 68 000167 69 000171 71 000172 72 000175 73 000200 74 000203 79 000205 80 000207 81 000222 82 000234 83 000235 84 000251 88 000263 89 000266 90 000271 91 000277 93 000300 94 000307 95 000312 96 000314 97 000316 99 000317 100 000322 101 000324 103 000326 105 000327 106 000333 107 000340 108 000344 109 000345 110 000360 111 000371 112 000374 113 000410 114 000422 115 000430 116 000433 117 000435 118 000436 119 000440 120 000442 121 000444 122 000450 123 000456 124 000472 125 000501 126 000511 127 000513 129 000514 130 000516 131 000521 ----------------------------------------------------------- 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