COMPILATION LISTING OF SEGMENT hex Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1832.8 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 hexadecimal: hex: proc; 12 13 /* Implements the hexadecimal, decimal, octal and binary commands/afs. 14* Written 03/09/81 S. Herbst */ 15 16 17 /* Based */ 18 19 dcl arg char (arg_len) based (arg_ptr); 20 dcl return_arg char (return_len) varying based (return_ptr); 21 22 23 /* Automatic */ 24 25 dcl ME char (32); 26 dcl val_str char (72) varying; 27 28 dcl af_sw bit (1) aligned; 29 30 dcl (arg_ptr, return_ptr) ptr; 31 32 dcl char8 char (8); 33 dcl float59 float dec (59); 34 dcl fixed71 fixed bin (71); 35 dcl (arg_len, return_len) fixed bin (21); 36 dcl (digit_val, input_base) fixed bin (5); 37 dcl (arg_count, arg_index, base, i, point_count) fixed bin; 38 dcl code fixed bin (35); 39 40 dcl error_table_$bad_conversion fixed bin (35) ext; 41 dcl error_table_$not_act_fnc fixed bin (35) ext; 42 43 dcl complain entry variable options (variable); 44 45 dcl (active_fnc_err_, active_fnc_err_$af_suppress_name) entry options (variable); 46 dcl (com_err_, com_err_$suppress_name) entry options (variable); 47 dcl cu_$af_return_arg entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); 48 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin (21), fixed bin (35)); 49 dcl (ioa_, ioa_$nnl) entry options (variable); 50 dcl numeric_to_ascii_base_ entry (float dec (59), fixed bin, fixed bin) returns (char (72) varying); 51 52 dcl (convert, decimal, index, low, substr, unspec) builtin; 53 54 dcl (conversion, overflow, underflow) condition; 55 56 57 ME = "hexadecimal"; 58 base = 16; 59 go to START; 60 61 decimal: dec: entry; 62 63 ME = "decimal"; 64 base = 10; 65 go to START; 66 67 octal: oct: entry; 68 69 ME = "octal"; 70 base = 8; 71 go to START; 72 73 binary: bin: entry; 74 75 ME = "binary"; 76 base = 2; 77 go to START; 78 79 80 START: 81 call cu_$af_return_arg (arg_count, return_ptr, return_len, code); 82 if code = error_table_$not_act_fnc then do; 83 if arg_count = 0 then do; 84 call com_err_$suppress_name (0, ME, "Usage: ^a num_args", ME); 85 return; 86 end; 87 af_sw = "0"b; 88 complain = com_err_; 89 end; 90 else if code = 0 then do; 91 if arg_count = 0 then do; 92 call active_fnc_err_$af_suppress_name (0, ME, "Usage: [^a num_args]", ME); 93 return; 94 end; 95 af_sw = "1"b; 96 complain = active_fnc_err_; 97 return_arg = ""; 98 end; 99 else do; 100 call active_fnc_err_ (code, ME); 101 return; 102 end; 103 104 on conversion, overflow, underflow go to BAD_NUM; 105 106 do arg_index = 1 to arg_count; 107 108 call cu_$arg_ptr (arg_index, arg_ptr, arg_len, code); 109 110 if arg_len = 0 then float59 = 0; 111 else do; 112 113 i = index ("bqox", substr (arg, arg_len, 1)); 114 if i ^= 0 then do; 115 input_base = 2 ** i; 116 float59 = 0; 117 point_count = -1; /* scanning for decimal point */ 118 119 do i = 1 to arg_len - 1; 120 121 if substr (arg, i, 1) = "." then do; 122 if point_count >= 0 then do; 123 BAD_NUM: call complain (error_table_$bad_conversion, ME, "^a", arg); 124 return; 125 end; 126 point_count = 0; 127 end; 128 else do; 129 digit_val = index ("0123456789ABCDEFabcdef", substr (arg, i, 1)) - 1; 130 if digit_val < 0 then go to BAD_NUM; 131 if digit_val > 15 then digit_val = digit_val - 6; /* lowercase abcdef */ 132 if digit_val >= input_base then go to BAD_NUM; 133 134 if point_count >= 0 then point_count = point_count + 1; /* after the decimal point */ 135 136 float59 = float59 * decimal (input_base, 2) + decimal (digit_val, 2); 137 end; 138 end; 139 140 if point_count > 0 then /* decimal point in the input */ 141 float59 = float59 / decimal (input_base ** point_count); 142 end; 143 else if substr (arg, arg_len, 1) = "u" then do; /* unspec */ 144 arg_len = arg_len - 1; 145 if arg_len > 8 then do; 146 call complain (0, ME, """u"" conversion only allows 8 characters. ^au", arg); 147 return; 148 end; 149 char8 = low (8 - arg_len) || arg; 150 unspec (fixed71) = unspec (char8); 151 float59 = fixed71; 152 end; 153 else float59 = convert (float59, arg); 154 end; 155 156 val_str = numeric_to_ascii_base_ (float59, 0, base); 157 APPEND: 158 if af_sw then do; 159 if return_arg ^= "" then return_arg = return_arg || " "; 160 return_arg = return_arg || val_str; 161 end; 162 else call ioa_$nnl ("^a ", val_str); 163 end; 164 165 if ^af_sw then call ioa_ (""); 166 167 end hexadecimal; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1630.8 hex.pl1 >dumps>old>recomp>hex.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. ME 000100 automatic char(32) unaligned dcl 25 set ref 57* 63* 69* 75* 84* 84* 92* 92* 100* 123* 146* active_fnc_err_ 000016 constant entry external dcl 45 ref 96 100 active_fnc_err_$af_suppress_name 000020 constant entry external dcl 45 ref 92 af_sw 000133 automatic bit(1) dcl 28 set ref 87* 95* 157 165 arg based char unaligned dcl 19 set ref 113 121 123* 129 143 146* 149 153 arg_count 000170 automatic fixed bin(17,0) dcl 37 set ref 80* 83 91 106 arg_index 000171 automatic fixed bin(17,0) dcl 37 set ref 106* 108* arg_len 000164 automatic fixed bin(21,0) dcl 35 set ref 108* 110 113 113 119 121 123 123 129 143 143 144* 144 145 146 146 149 149 153 arg_ptr 000134 automatic pointer dcl 30 set ref 108* 113 121 123 129 143 146 149 153 base 000172 automatic fixed bin(17,0) dcl 37 set ref 58* 64* 70* 76* 156* char8 000140 automatic char(8) unaligned dcl 32 set ref 149* 150 code 000175 automatic fixed bin(35,0) dcl 38 set ref 80* 82 90 100* 108* com_err_ 000022 constant entry external dcl 46 ref 88 com_err_$suppress_name 000024 constant entry external dcl 46 ref 84 complain 000176 automatic entry variable dcl 43 set ref 88* 96* 123 146 conversion 000202 stack reference condition dcl 54 ref 104 convert builtin function dcl 52 ref 153 cu_$af_return_arg 000026 constant entry external dcl 47 ref 80 cu_$arg_ptr 000030 constant entry external dcl 48 ref 108 decimal builtin function dcl 52 ref 136 136 140 digit_val 000166 automatic fixed bin(5,0) dcl 36 set ref 129* 130 131 131* 131 132 136 error_table_$bad_conversion 000012 external static fixed bin(35,0) dcl 40 set ref 123* error_table_$not_act_fnc 000014 external static fixed bin(35,0) dcl 41 ref 82 fixed71 000162 automatic fixed bin(71,0) dcl 34 set ref 150* 151 float59 000142 automatic float dec(59) dcl 33 set ref 110* 116* 136* 136 140* 140 151* 153* 153 156* i 000173 automatic fixed bin(17,0) dcl 37 set ref 113* 114 115 119* 121 129* index builtin function dcl 52 ref 113 129 input_base 000167 automatic fixed bin(5,0) dcl 36 set ref 115* 132 136 140 ioa_ 000032 constant entry external dcl 49 ref 165 ioa_$nnl 000034 constant entry external dcl 49 ref 162 low builtin function dcl 52 ref 149 numeric_to_ascii_base_ 000036 constant entry external dcl 50 ref 156 overflow 000210 stack reference condition dcl 54 ref 104 point_count 000174 automatic fixed bin(17,0) dcl 37 set ref 117* 122 126* 134 134* 134 140 140 return_arg based varying char dcl 20 set ref 97* 159 159* 159 160* 160 return_len 000165 automatic fixed bin(21,0) dcl 35 set ref 80* 97 159 160 return_ptr 000136 automatic pointer dcl 30 set ref 80* 97 159 159 159 160 160 substr builtin function dcl 52 ref 113 121 129 143 underflow 000216 stack reference condition dcl 54 ref 104 unspec builtin function dcl 52 set ref 150* 150 val_str 000110 automatic varying char(72) dcl 26 set ref 156* 160 162* NAMES DECLARED BY EXPLICIT CONTEXT. APPEND 001005 constant label dcl 157 BAD_NUM 000525 constant label dcl 123 ref 104 130 132 START 000210 constant label dcl 80 ref 59 65 71 77 bin 000166 constant entry external dcl 73 binary 000175 constant entry external dcl 73 dec 000120 constant entry external dcl 61 decimal 000127 constant entry external dcl 61 hex 000075 constant entry external dcl 11 hexadecimal 000104 constant entry external dcl 11 oct 000143 constant entry external dcl 67 octal 000152 constant entry external dcl 67 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1316 1356 1101 1326 Length 1546 1101 40 154 214 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME hex 408 external procedure is an external procedure. on unit on line 104 64 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME hex 000100 ME hex 000110 val_str hex 000133 af_sw hex 000134 arg_ptr hex 000136 return_ptr hex 000140 char8 hex 000142 float59 hex 000162 fixed71 hex 000164 arg_len hex 000165 return_len hex 000166 digit_val hex 000167 input_base hex 000170 arg_count hex 000171 arg_index hex 000172 base hex 000173 i hex 000174 point_count hex 000175 code hex 000176 complain hex THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. fx1_to_fl2 alloc_cs cat_realloc_cs call_var_desc call_ext_out_desc call_ext_out return tra_ext enable shorten_stack ext_entry int_entry real_to_real_rd any_to_any_rd real_p_int THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. active_fnc_err_ active_fnc_err_$af_suppress_name com_err_ com_err_$suppress_name cu_$af_return_arg cu_$arg_ptr decimal_exp_ ioa_ ioa_$nnl numeric_to_ascii_base_ THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_conversion error_table_$not_act_fnc LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000074 57 000111 58 000114 59 000116 61 000117 63 000134 64 000137 65 000141 67 000142 69 000157 70 000162 71 000164 73 000165 75 000202 76 000205 77 000207 80 000210 82 000225 83 000231 84 000233 85 000262 87 000263 88 000264 89 000270 90 000271 91 000273 92 000275 93 000327 95 000330 96 000332 97 000336 98 000337 100 000340 101 000354 104 000355 106 000406 108 000415 110 000432 113 000440 114 000452 115 000453 116 000477 117 000502 119 000504 121 000514 122 000523 123 000525 124 000557 126 000560 127 000561 129 000562 130 000572 131 000573 132 000577 134 000602 136 000605 138 000623 140 000625 142 000654 143 000655 144 000662 145 000664 146 000667 147 000721 149 000722 150 000745 151 000750 152 000756 153 000757 156 000767 157 001005 159 001007 160 001024 161 001036 162 001037 163 001056 165 001060 167 001073 ----------------------------------------------------------- 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