COMPILATION LISTING OF SEGMENT cv_ascii_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 1014.1 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/22/76 * 14* * * 15* ***************************************************************************** */ 16 17 cv_ascii_to_bcd_: proc (a_input_ptr, a_output_ptr, a_code); 18 19 /* Procedure to convert Multics ascii to GCOS 14 bit binary. 20* 21* Arguments are: 22* 23* a_input_ptr pointer to an 80 character aligned input string (input) 24* a_output_ptr pointer to a 14 word aligned output string (input) 25* a_code 0 = successful, 1 = unsuccessful (output) 26* 27* */ 28 29 30 /* DECLARATIONS */ 31 32 /* fixed bin */ 33 34 dcl (i, /* loop index */ 35 index, /* index into character arrays */ 36 interval, /* half interval search interval */ 37 j /* loop index */ 38 ) fixed bin aligned; 39 40 dcl ( 41 a_code, /* error code (argument) */ 42 code init (0) /* error code (internal) */ 43 ) fixed bin (35) aligned; 44 45 46 /* pointers */ 47 48 dcl ( 49 a_input_ptr, /* pointer to ascii input string (argument) */ 50 a_output_ptr, /* pointer to bcd output string (argument) */ 51 input_ptr, /* pointer to ascii input string (internal) */ 52 output_ptr /* pointer to bcd output string (internal) */ 53 ) ptr aligned; 54 55 56 /* bit strings */ 57 58 dcl ( 59 ascii_char_not_found /* ON until match is found with current input char */ 60 ) bit (1) aligned; 61 62 63 /* built in functions */ 64 65 dcl ( 66 divide, 67 fixed, 68 unspec 69 ) builtin; 70 71 72 /* structures */ 73 74 dcl a_table (64) char (1) aligned init ( /* ascii table */ 75 " ", 76 "!", 77 """", 78 "#", 79 "$", 80 "%", 81 "&", 82 "'", 83 "(", 84 ")", 85 "*", 86 "+", 87 ",", 88 "-", 89 ".", 90 "/", 91 "0", 92 "1", 93 "2", 94 "3", 95 "4", 96 "5", 97 "6", 98 "7", 99 "8", 100 "9", 101 ":", 102 ";", 103 "<", 104 "=", 105 ">", 106 "?", 107 "@", 108 "[", 109 "\", 110 "]", 111 "^", 112 "_", 113 "a", 114 "b", 115 "c", 116 "d", 117 "e", 118 "f", 119 "g", 120 "h", 121 "i", 122 "j", 123 "k", 124 "l", 125 "m", 126 "n", 127 "o", 128 "p", 129 "q", 130 "r", 131 "s", 132 "t", 133 "u", 134 "v", 135 "w", 136 "x", 137 "y", 138 "z" 139 ); 140 141 dcl b_table (64) bit (6) aligned init ( /* bcd table */ 142 "010000"b, 143 "111111"b, 144 "111110"b, 145 "001011"b, 146 "101011"b, 147 "111100"b, 148 "011010"b, 149 "101111"b, 150 "011101"b, 151 "101101"b, 152 "101100"b, 153 "110000"b, 154 "111011"b, 155 "101010"b, 156 "011011"b, 157 "110001"b, 158 "000000"b, 159 "000001"b, 160 "000010"b, 161 "000011"b, 162 "000100"b, 163 "000101"b, 164 "000110"b, 165 "000111"b, 166 "001000"b, 167 "001001"b, 168 "001101"b, 169 "101110"b, 170 "011110"b, 171 "111101"b, 172 "001110"b, 173 "001111"b, 174 "001100"b, 175 "001010"b, 176 "011111"b, 177 "011100"b, 178 "100000"b, 179 "111010"b, 180 "010001"b, 181 "010010"b, 182 "010011"b, 183 "010100"b, 184 "010101"b, 185 "010110"b, 186 "010111"b, 187 "011000"b, 188 "011001"b, 189 "100001"b, 190 "100010"b, 191 "100011"b, 192 "100100"b, 193 "100101"b, 194 "100110"b, 195 "100111"b, 196 "101000"b, 197 "101001"b, 198 "110010"b, 199 "110011"b, 200 "110100"b, 201 "110101"b, 202 "110110"b, 203 "110111"b, 204 "111000"b, 205 "111001"b 206 ); 207 208 209 /* masks */ 210 211 dcl 1 ascii_string aligned based (input_ptr), /* for looking at ascii string */ 212 2 ascii_char (80) char (1) unaligned; 213 214 dcl 1 bcd_string aligned based (output_ptr), /* for looking at bcd string */ 215 2 bcd_char (80) bit (6) unaligned, 216 2 bcd_pad bit (24) unaligned; /* for filling out to last word boundary */ 217 218 /* */ 219 220 input_ptr = a_input_ptr; /* copy arguments */ 221 output_ptr = a_output_ptr; 222 223 do i = 1 to 80 while (code = 0); /* per character loop */ 224 225 if ascii_char (i) = " " /* make quick check for blank */ 226 then do; 227 bcd_char (i) = "010000"b; 228 ascii_char_not_found = "0"b; 229 end; 230 231 else /* character is not a blank */ 232 do; 233 234 ascii_char_not_found = "1"b; /* set search flag */ 235 index = 32; /* index into character arrayx */ 236 interval = 32; /* and search interval */ 237 238 do j = 1 to 6 while (ascii_char_not_found); /* half-interval search loop */ 239 240 if ascii_char (i) = a_table (index) /* match found */ 241 then do; 242 ascii_char_not_found = "0"b; 243 bcd_char (i) = b_table (index); 244 end; 245 246 else /* match not found */ 247 do; 248 interval = divide (interval, 2, 17, 0); /* split search interval */ 249 if fixed (unspec (ascii_char (i)), 9) < fixed (unspec (a_table (index)), 9) 250 /* set direction of search */ 251 then index = index - interval; 252 else 253 index = index + interval; 254 end; 255 256 end; 257 258 if ascii_char_not_found /* error, invalid input character */ 259 then code = 1; 260 261 end; 262 263 if code = 0 /* conversion was successful */ 264 then bcd_pad = "010000010000010000010000"b; 265 266 a_code = code; /* return error code */ 267 268 end; 269 270 return; 271 272 end cv_ascii_to_bcd_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/19/82 0933.8 cv_ascii_to_bcd_.pl1 >spec>on>11/19/82>cv_ascii_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 40 set ref 17 266* a_input_ptr parameter pointer dcl 48 ref 17 220 a_output_ptr parameter pointer dcl 48 ref 17 221 a_table 000113 automatic char(1) initial array dcl 74 set ref 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 74* 240 249 ascii_char based char(1) array level 2 packed unaligned dcl 211 ref 225 240 249 ascii_char_not_found 000112 automatic bit(1) dcl 58 set ref 228* 234* 238 242* 258 ascii_string based structure level 1 dcl 211 b_table 000213 automatic bit(6) initial array dcl 141 set ref 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 141* 243 bcd_char based bit(6) array level 2 packed unaligned dcl 214 set ref 227* 243* bcd_pad 15(12) based bit(24) level 2 packed unaligned dcl 214 set ref 263* bcd_string based structure level 1 dcl 214 code 000104 automatic fixed bin(35,0) initial dcl 40 set ref 40* 223 258* 263 266 divide builtin function dcl 65 ref 248 fixed builtin function dcl 65 ref 249 249 i 000100 automatic fixed bin(17,0) dcl 34 set ref 223* 225 227 240 243 249* index 000101 automatic fixed bin(17,0) dcl 34 set ref 235* 240 243 249 249* 249 252* 252 input_ptr 000106 automatic pointer dcl 48 set ref 220* 225 240 249 interval 000102 automatic fixed bin(17,0) dcl 34 set ref 236* 248* 248 249 252 j 000103 automatic fixed bin(17,0) dcl 34 set ref 238* output_ptr 000110 automatic pointer dcl 48 set ref 221* 227 243 263 unspec builtin function dcl 65 ref 249 249 NAME DECLARED BY EXPLICIT CONTEXT. cv_ascii_to_bcd_ 000007 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 1204 1214 1156 1214 Length 1356 1156 10 125 26 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cv_ascii_to_bcd_ 206 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cv_ascii_to_bcd_ 000100 i cv_ascii_to_bcd_ 000101 index cv_ascii_to_bcd_ 000102 interval cv_ascii_to_bcd_ 000103 j cv_ascii_to_bcd_ 000104 code cv_ascii_to_bcd_ 000106 input_ptr cv_ascii_to_bcd_ 000110 output_ptr cv_ascii_to_bcd_ 000112 ascii_char_not_found cv_ascii_to_bcd_ 000113 a_table cv_ascii_to_bcd_ 000213 b_table cv_ascii_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 000003 40 000014 74 000015 141 000416 220 001016 221 001022 223 001025 225 001034 227 001042 228 001050 229 001051 234 001052 235 001054 236 001056 238 001057 240 001066 242 001076 243 001077 244 001106 248 001107 249 001112 252 001131 256 001133 258 001135 263 001141 266 001146 268 001150 270 001152 ----------------------------------------------------------- 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