COMPILATION LISTING OF SEGMENT cv_bin_to_bcd_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/19/82 0959.7 mst Fri 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 /* ****************************************************************************** 12* * * 13* * Modified by RH Morrison 6/28/76 * 14* * * 15* ****************************************************************************** */ 16 17 cv_bin_to_bcd_: proc (a_input_ptr, a_output_ptr, a_code); 18 19 20 /* DECLARATIONS */ 21 /* ------------ */ 22 23 24 /* fixed bin */ 25 26 dcl ( 27 direction, /* direction of half-interval search */ 28 i, /* loop index */ 29 interval, /* increment for half-interval search */ 30 j, /* loop index */ 31 search_index /* index into binary table */ 32 ) fixed bin aligned; 33 34 dcl ( 35 a_code /* error code (argument) */ 36 ) fixed bin (35) aligned; 37 38 39 /* pointers */ 40 41 dcl ( 42 a_input_ptr, /* pointer to binary data (argument) */ 43 a_output_ptr, /* pointer to bcd output (argument) */ 44 bcd_ptr, /* pointer to internal bcd */ 45 input_ptr, /* pointer to binary data (internal) */ 46 output_ptr /* pointer to bcd output (internal) */ 47 ) ptr aligned; 48 49 50 /* bit strings */ 51 52 dcl ( 53 bin_char_not_found /* ON until bin_table search is successful */ 54 ) bit (1) aligned; 55 56 57 /* built in functions */ 58 59 dcl ( 60 addr, 61 divide 62 ) builtin; 63 64 65 /* structures */ 66 67 dcl 1 bcd_chars aligned, /* bcd output structure */ 68 2 bcd_char (0:79) bit (6) unaligned; 69 70 dcl bcd_table (0:63) bit (6) aligned internal static init ( 71 "010000"b, /* " " */ 72 "001001"b, /* "9" */ 73 "001000"b, /* "8" */ 74 "000111"b, /* "7" */ 75 "001111"b, /* "?" */ 76 "000110"b, /* "6" */ 77 "001110"b, /* ">" */ 78 "000101"b, /* "5" */ 79 "001101"b, /* ":" */ 80 "000100"b, /* "4" */ 81 "001100"b, /* "@" */ 82 "000011"b, /* "3" */ 83 "001011"b, /* "#" */ 84 "000010"b, /* "2" */ 85 "001010"b, /* "[" */ 86 "000001"b, /* "1" */ 87 "000000"b, /* "0" */ 88 "111001"b, /* "z" */ 89 "111000"b, /* "y" */ 90 "110111"b, /* "x" */ 91 "111111"b, /* "!" */ 92 "110110"b, /* "w" */ 93 "111110"b, /* """ */ 94 "110101"b, /* "v" */ 95 "111101"b, /* "=" */ 96 "110100"b, /* "u" */ 97 "111100"b, /* "%" */ 98 "110011"b, /* "t" */ 99 "111011"b, /* "," */ 100 "110010"b, /* "s" */ 101 "111010"b, /* "<-" */ 102 "110001"b, /* "/" */ 103 "101010"b, /* "-" */ 104 "101001"b, /* "r" */ 105 "101000"b, /* "q" */ 106 "100111"b, /* "p" */ 107 "101111"b, /* "'" */ 108 "100110"b, /* "o" */ 109 "101110"b, /* ";" */ 110 "100101"b, /* "n" */ 111 "101101"b, /* ")" */ 112 "100100"b, /* "m" */ 113 "101100"b, /* "*" */ 114 "100011"b, /* "l" */ 115 "101011"b, /* "$" */ 116 "100010"b, /* "k" */ 117 "100001"b, /* "j" */ 118 "100000"b, /* "^" */ 119 "011010"b, /* "&" */ 120 "011001"b, /* "i" */ 121 "011000"b, /* "h" */ 122 "010111"b, /* "g" */ 123 "011111"b, /* "\" */ 124 "010110"b, /* "f" */ 125 "011110"b, /* "<" */ 126 "010101"b, /* "e" */ 127 "011101"b, /* "(" */ 128 "010100"b, /* "d" */ 129 "011100"b, /* "]" */ 130 "010011"b, /* "c" */ 131 "011011"b, /* "." */ 132 "010010"b, /* "b" */ 133 "010001"b, /* "a" */ 134 "110000"b /* "+" */ 135 ); 136 137 dcl bin_table (0: 63) bit (12) aligned internal static init ( 138 "000000000000"b, 139 "000000000001"b, 140 "000000000010"b, 141 "000000000100"b, 142 "000000000110"b, 143 "000000001000"b, 144 "000000001010"b, 145 "000000010000"b, 146 "000000010010"b, 147 "000000100000"b, 148 "000000100010"b, 149 "000001000000"b, 150 "000001000010"b, 151 "000010000000"b, 152 "000010000010"b, 153 "000100000000"b, 154 "001000000000"b, 155 "001000000001"b, 156 "001000000010"b, 157 "001000000100"b, 158 "001000000110"b, 159 "001000001000"b, 160 "001000001010"b, 161 "001000010000"b, 162 "001000010010"b, 163 "001000100000"b, 164 "001000100010"b, 165 "001001000000"b, 166 "001001000010"b, 167 "001010000000"b, 168 "001010000010"b, 169 "001100000000"b, 170 "010000000000"b, 171 "010000000001"b, 172 "010000000010"b, 173 "010000000100"b, 174 "010000000110"b, 175 "010000001000"b, 176 "010000001010"b, 177 "010000010000"b, 178 "010000010010"b, 179 "010000100000"b, 180 "010000100010"b, 181 "010001000000"b, 182 "010001000010"b, 183 "010010000000"b, 184 "010100000000"b, 185 "011000000000"b, 186 "100000000000"b, 187 "100000000001"b, 188 "100000000010"b, 189 "100000000100"b, 190 "100000000110"b, 191 "100000001000"b, 192 "100000001010"b, 193 "100000010000"b, 194 "100000010010"b, 195 "100000100000"b, 196 "100000100010"b, 197 "100001000000"b, 198 "100001000010"b, 199 "100010000000"b, 200 "100100000000"b, 201 "101000000000"b 202 ); 203 204 205 /* masks */ 206 207 dcl bcd_output bit (480) unaligned based (bcd_ptr); /* mask for copying bcd as a whole */ 208 209 dcl bin_char (0:79) bit (12) unaligned based (input_ptr); /* mask for looking at binary input */ 210 211 /* */ 212 213 /* copy in arguments */ 214 215 input_ptr = a_input_ptr; 216 output_ptr = a_output_ptr; 217 bcd_ptr = addr (bcd_chars); /* pointer to internal bcd */ 218 219 /* perform conversion */ 220 221 do i = 0 to 79; /* convert 80 characters */ 222 223 if bin_char (i) = "0"b /* make quick check for blank */ 224 then bcd_char (i) = "010000"b; 225 226 else /* not binary blank */ 227 do; 228 229 direction = 1; /* set up half-interval search */ 230 interval = 32; 231 search_index = 0; 232 bin_char_not_found = "1"b; 233 234 do j = 1 to 6 while (bin_char_not_found); 235 236 search_index = search_index + direction*interval; /* compute index into binary table */ 237 238 if bin_char (i) = bin_table (search_index) /* match found */ 239 then do; 240 bcd_char (i) = bcd_table (search_index); /* set bcd character */ 241 bin_char_not_found = "0"b; 242 end; 243 244 else /* not a match */ 245 do; 246 if bin_char (i) > bin_table (search_index) /* set direction of search increment */ 247 then direction = 1; 248 else direction = -1; 249 interval = divide (interval, 2, 17, 0); /* set search increment magnitude */ 250 end; 251 252 end; 253 254 if bin_char_not_found /* no match found */ 255 then go to ERROR; /* illegal binary character */ 256 257 end; 258 259 end; 260 261 output_ptr -> bcd_output = bcd_output; /* return output string */ 262 a_code = 0; /* and "successful" code */ 263 264 return; /* and your own self */ 265 266 ERROR: 267 268 a_code = 1; /* return "unsuccessful" code */ 269 270 return; 271 272 end cv_bin_to_bcd_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/19/82 0929.2 cv_bin_to_bcd_.pl1 >spec>on>11/19/82>cv_bin_to_bcd_.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. a_code parameter fixed bin(35,0) dcl 34 set ref 17 262* 266* a_input_ptr parameter pointer dcl 41 ref 17 215 a_output_ptr parameter pointer dcl 41 ref 17 216 addr builtin function dcl 59 ref 217 bcd_char 000115 automatic bit(6) array level 2 packed unaligned dcl 67 set ref 223* 240* bcd_chars 000115 automatic structure level 1 dcl 67 set ref 217 bcd_output based bit(480) unaligned dcl 207 set ref 261* 261 bcd_ptr 000106 automatic pointer dcl 41 set ref 217* 261 bcd_table 000100 constant bit(6) initial array dcl 70 ref 240 bin_char based bit(12) array unaligned dcl 209 ref 223 238 246 bin_char_not_found 000114 automatic bit(1) dcl 52 set ref 232* 234 241* 254 bin_table 000000 constant bit(12) initial array dcl 137 ref 238 246 direction 000100 automatic fixed bin(17,0) dcl 26 set ref 229* 236 246* 248* divide builtin function dcl 59 ref 249 i 000101 automatic fixed bin(17,0) dcl 26 set ref 221* 223 223 238 240 246* input_ptr 000110 automatic pointer dcl 41 set ref 215* 223 238 246 interval 000102 automatic fixed bin(17,0) dcl 26 set ref 230* 236 249* 249 j 000103 automatic fixed bin(17,0) dcl 26 set ref 234* output_ptr 000112 automatic pointer dcl 41 set ref 216* 261 search_index 000104 automatic fixed bin(17,0) dcl 26 set ref 231* 236* 236 238 240 246 NAMES DECLARED BY EXPLICIT CONTEXT. ERROR 000342 constant label dcl 266 ref 254 cv_bin_to_bcd_ 000206 constant entry external dcl 17 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 374 404 347 404 Length 546 347 10 125 25 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cv_bin_to_bcd_ 92 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cv_bin_to_bcd_ 000100 direction cv_bin_to_bcd_ 000101 i cv_bin_to_bcd_ 000102 interval cv_bin_to_bcd_ 000103 j cv_bin_to_bcd_ 000104 search_index cv_bin_to_bcd_ 000106 bcd_ptr cv_bin_to_bcd_ 000110 input_ptr cv_bin_to_bcd_ 000112 output_ptr cv_bin_to_bcd_ 000114 bin_char_not_found cv_bin_to_bcd_ 000115 bcd_chars cv_bin_to_bcd_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return ext_entry 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 17 000202 215 000213 216 000217 217 000222 221 000224 223 000230 229 000244 230 000246 231 000250 232 000251 234 000253 236 000262 238 000270 240 000302 241 000310 242 000311 246 000312 248 000317 249 000321 252 000324 254 000326 259 000330 261 000332 262 000337 264 000341 266 000342 270 000345 ----------------------------------------------------------- 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