COMPILATION LISTING OF SEGMENT idsort_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1806.0 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 idsort_: proc (v, x, n); 12 13 /* Singleton sort - from Max Smith */ 14 15 dcl v (*) char (32) aligned, /* 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) char (32) aligned, 24 xk fixed bin, 25 vxk char (32) aligned, 26 xl fixed bin, 27 xq fixed bin, 28 vxq char (32) aligned; 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 return; 121 i = stacki (m); 122 j = stackj (m); 123 go to test; 124 125 end idsort_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1608.8 idsort_.pl1 >dumps>old>recomp>idsort_.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* 121* 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 122* 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 121 122 n parameter fixed bin(17,0) dcl 15 ref 11 35 q 000105 automatic fixed bin(17,0) dcl 19 set ref 40* 45 51 61 66 71 stacki 000153 automatic fixed bin(17,0) array dcl 30 set ref 94* 99* 121 stackj 000175 automatic fixed bin(17,0) array dcl 30 set ref 95* 100* 122 v parameter char(32) array dcl 15 ref 11 42 44 46 81 84 110 113 vxi 000110 automatic char(32) dcl 19 set ref 42* 47 47 62 64 74 vxj 000120 automatic char(32) dcl 19 set ref 44* 47 47 53 64 64 68 vxk 000131 automatic char(32) dcl 19 set ref 110* 113 vxq 000143 automatic char(32) 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* 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 xk 000130 automatic fixed bin(17,0) dcl 19 set ref 83* 84 90 109* 110 115 xl 000141 automatic fixed bin(17,0) dcl 19 set ref 80* 81 89 112* 113 114 xq 000142 automatic fixed bin(17,0) dcl 19 set ref 45* 46 50 60 67 73 NAMES DECLARED BY EXPLICIT CONTEXT. bubble 000425 constant label dcl 111 ref 117 idsort_ 000015 constant entry external dcl 11 kloop 000263 constant label dcl 82 ref 84 lloop 000231 constant label dcl 79 ref 81 91 ok 000476 constant label dcl 118 ref 113 sloop 000031 constant label dcl 38 ref 105 106 test 000361 constant label dcl 105 ref 36 123 NAME DECLARED BY CONTEXT OR IMPLICATION. divide builtin function ref 40 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 536 546 512 546 Length 704 512 10 121 23 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME idsort_ 147 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME idsort_ 000100 i idsort_ 000101 j idsort_ 000102 k idsort_ 000103 l idsort_ 000104 m idsort_ 000105 q idsort_ 000106 xi idsort_ 000107 xj idsort_ 000110 vxi idsort_ 000120 vxj idsort_ 000130 xk idsort_ 000131 vxk idsort_ 000141 xl idsort_ 000142 xq idsort_ 000143 vxq idsort_ 000153 stacki idsort_ 000175 stackj idsort_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. 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 000067 44 000076 45 000104 46 000113 47 000121 50 000135 51 000140 52 000143 53 000146 54 000151 56 000152 57 000155 58 000160 60 000161 61 000164 62 000167 63 000172 64 000173 66 000203 67 000206 68 000211 69 000214 71 000215 72 000220 73 000223 74 000226 79 000231 80 000233 81 000246 82 000263 83 000264 84 000300 88 000314 89 000317 90 000322 91 000331 93 000332 94 000341 95 000344 96 000346 97 000350 99 000351 100 000354 101 000356 103 000360 105 000361 106 000365 107 000372 108 000376 109 000377 110 000412 111 000425 112 000430 113 000444 114 000461 115 000470 116 000473 117 000475 118 000476 119 000500 120 000502 121 000504 122 000506 123 000511 ----------------------------------------------------------- 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