COMPILATION LISTING OF SEGMENT dump_gcos Compiled by: Multics PL/I Compiler, Release 28b, of April 11, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 09/09/83 1057.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 dump_gcos: dgc: proc; 12 13 /* Command to dump a GCOS standard system format file, doing less printing 14* than dump_segment or dump_segment -bcd. 15* 16* USAGE: dgc pathname -octal_offset- -bcd -line_length (-ll) n 17* 18* If octal offset is omitted, it defaults to zero. If it is given, it is 19* rounded DOWN to the beginning of the 320 (decimal) word block in which 20* it falls. Dumping always begins on a 320-word boundary. 21* 22* Dumping will proceed until the user QUIT's, or until an end of file (octal 17) 23* is found (in which case the user will be given the choice of quitting or 24* continuing), or a block control word of all zeros is found, which always 25* terminates the dump. 26* 27* If -bcd (or -ch) is given, the contents of BCD or ASCII records is printed 28* (the BCD being converted to ASCII for printing), preceeded by the rcw and its 29* offset. For binary card records, the offset and rcw, and the words BINARY CARD 30* are printed. 31* 32* If -bcd is not given, just bcw and rcws (and their offsets) are printed. 33* 34* The -line_length n argument may be used to control the number of rcws placed 35* on each line. The default is 80, which is room for 4 rcws and their offsets. 36* Once set, the line length is remembered in internal static for the remainder 37* of the process. 38* 39* WRITTEN BY T. Casey July 1974 40* 41* MODIFIED BY S. Akers September 1981 42* 43* Changed error_table_$badarg 44* to error_table_$badopt. 45* 46* Fixed "USAGE" error to prevent 47* garbage in error message. 48* 49**/ 50 51 /* D E C L A R A T I O N S */ 52 53 /* External Entries */ 54 55 dcl cu_$arg_count entry (fixed bin); 56 dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); 57 dcl (cv_dec_check_, cv_oct_check_) entry (char (*), fixed bin (35)) returns (fixed bin); 58 dcl (ioa_, com_err_) entry options (variable); 59 dcl hcs_$initiate_count entry (char (*), char (*), char (*), fixed bin (24), fixed bin (2), ptr, fixed bin (35)); 60 dcl hcs_$terminate_noname entry (ptr, fixed bin (35)); 61 dcl (bcdmp, bcdmp$gcdmp) entry (ptr); 62 dcl bcdmp$set_max_line_len entry (fixed bin); 63 dcl expand_path_ entry (ptr, fixed bin, ptr, ptr, fixed bin (35)); 64 65 /* Work Variables */ 66 dcl argp ptr; 67 dcl argl fixed bin; 68 dcl arg char (argl) based (argp); 69 dcl (argno, nargs) fixed bin; 70 71 dcl code fixed bin (35); 72 73 dcl err_msg char (200) varying; 74 dcl err_arg char (168); 75 dcl numeric_arg fixed bin; 76 dcl given_path char (168) init (""); 77 dcl dirname char (168); 78 dcl ename char (32); 79 80 dcl offset fixed bin init (0); 81 dcl (bcdsw, expecting_ll) bit (1) aligned init ("0"b); 82 83 dcl (error_table_$noarg, error_table_$badopt) ext fixed bin (35); 84 85 dcl plen fixed bin; 86 dcl segptr ptr init (null); 87 dcl bitcount fixed bin (24); 88 dcl callptr ptr; 89 90 dcl (addr, divide, null, ptr) builtin; 91 92 dcl cleanup condition; 93 94 /* P R O C E D U R E */ 95 96 on condition (cleanup) begin; 97 if segptr ^= null then 98 call hcs_$terminate_noname (segptr, code); 99 end; 100 101 call cu_$arg_count (nargs); 102 if nargs = 0 103 then do; 104 code = 0; 105 err_msg = "USAGE: dgc path offset -bcd -line_length n"; 106 call_com_err: call com_err_ (code, "dump_gcos", err_msg, err_arg, numeric_arg); 107 exit: if segptr ^= null then do; 108 call hcs_$terminate_noname (segptr, code); 109 if code ^= 0 then do; 110 err_msg = "from hcs_$terminate_noname ^a"; 111 segptr = null; /* avoid infinite loop */ 112 show_expanded_path: /* come here from below */ 113 err_arg = substr (dirname, 1, index (dirname, " ")-1) || ">" 114 || substr (ename, 1, index (ename, " ")-1); 115 goto call_com_err; 116 end; 117 end; 118 return; 119 end; 120 121 arg_loop: do argno = 1 to nargs; 122 call cu_$arg_ptr (argno, argp, argl, code); 123 if code ^= 0 then do; 124 err_msg = "from cu_$arg_ptr ^s^d"; 125 numeric_arg = argno; 126 goto call_com_err; 127 end; 128 129 if expecting_ll then do; 130 expecting_ll = "0"b; 131 numeric_arg = cv_dec_check_ (arg, code); 132 if code ^= 0 then do; 133 code = 0; /* not an error_table_ code */ 134 err_msg = "bad line length argument: ^a"; 135 err_arg = arg; 136 end; 137 138 call bcdmp$set_max_line_len (numeric_arg); 139 end; 140 141 else if substr (arg, 1, 1) = "-" then do; /* control */ 142 if arg = "-bcd" | arg = "-ch" then 143 bcdsw = "1"b; 144 else if arg = "-ll" | arg = "-line_length" then 145 expecting_ll = "1"b; 146 else do; 147 code = error_table_$badopt; 148 err_arg = arg; 149 err_msg = "^a"; 150 goto call_com_err; 151 end; 152 end; /* end control arg */ 153 154 else do; /* path or offset */ 155 numeric_arg = cv_oct_check_ (arg, code); 156 if code ^= 0 then do; /* not an octal number */ 157 if given_path = "" then do; /* if path not already given */ 158 given_path = arg; /* assume this is it */ 159 plen = argl; /* for expand_path_ */ 160 end; 161 162 else do; 163 if offset ^= 0 then /* if offset given already */ 164 err_msg = "unknown argument: ^a"; 165 err_arg = arg; 166 goto call_com_err; 167 end; 168 end; /* end code ^= 0 */ 169 170 else offset = numeric_arg; 171 end; 172 173 end arg_loop; 174 175 if expecting_ll then do; 176 err_msg = "line length, after ^a"; 177 err_arg = arg; 178 noarg: code = error_table_$noarg; 179 goto call_com_err; 180 end; 181 182 if given_path = "" then do; 183 err_msg = "pathname of file to be dumped"; 184 goto noarg; 185 end; 186 187 call expand_path_ (addr (given_path), plen, addr (dirname), addr (ename), code); 188 if code ^= 0 then do; 189 err_msg = "from expand_path_ ^a"; 190 err_arg = given_path; 191 goto call_com_err; 192 end; 193 194 call hcs_$initiate_count (dirname, ename, "", bitcount, 0, segptr, code); 195 if segptr = null then do; 196 err_msg = "from hcs_$initiate_count ^a"; 197 goto show_expanded_path; 198 end; 199 else code = 0; /* clear possible segknown */ 200 201 bitcount = divide (bitcount-1, 36, 17, 0); /* compute offset of last word, from bitcount */ 202 if offset > bitcount then do; 203 call com_err_ (0, "dump_gcos", "offset (^o) is past last word (^o); last block will be dumped.", offset, bitcount); 204 offset = bitcount; 205 end; 206 207 callptr = ptr (segptr, offset); 208 209 if bcdsw then 210 call bcdmp (callptr); 211 else call bcdmp$gcdmp (callptr); 212 213 goto exit; 214 215 end dump_gcos; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 09/09/83 1006.5 dump_gcos.pl1 >spec>on>09/07/83-gcos>dump_gcos.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. addr builtin function dcl 90 ref 187 187 187 187 187 187 arg based char unaligned dcl 68 set ref 131* 135 141 142 142 144 144 148 155* 158 165 177 argl 000102 automatic fixed bin(17,0) dcl 67 set ref 122* 131 131 135 141 142 142 144 144 148 155 155 158 159 165 177 argno 000103 automatic fixed bin(17,0) dcl 69 set ref 121* 122* 125* argp 000100 automatic pointer dcl 66 set ref 122* 131 135 141 142 142 144 144 148 155 158 165 177 bcdmp 000026 constant entry external dcl 61 ref 209 bcdmp$gcdmp 000030 constant entry external dcl 61 ref 211 bcdmp$set_max_line_len 000032 constant entry external dcl 62 ref 138 bcdsw 000401 automatic bit(1) initial dcl 81 set ref 81* 142* 209 bitcount 000406 automatic fixed bin(24,0) dcl 87 set ref 194* 201* 201 202 203* 204 callptr 000410 automatic pointer dcl 88 set ref 207* 209* 211* cleanup 000412 stack reference condition dcl 92 ref 96 code 000105 automatic fixed bin(35,0) dcl 71 set ref 97* 104* 106* 108* 109 122* 123 131* 132 133* 147* 155* 156 178* 187* 188 194* 199* com_err_ 000020 constant entry external dcl 58 ref 106 203 cu_$arg_count 000010 constant entry external dcl 55 ref 101 cu_$arg_ptr 000012 constant entry external dcl 56 ref 122 cv_dec_check_ 000014 constant entry external dcl 57 ref 131 cv_oct_check_ 000016 constant entry external dcl 57 ref 155 dirname 000316 automatic char(168) unaligned dcl 77 set ref 112 112 187 187 194* divide builtin function dcl 90 ref 201 ename 000370 automatic char(32) unaligned dcl 78 set ref 112 112 187 187 194* err_arg 000171 automatic char(168) unaligned dcl 74 set ref 106* 112* 135* 148* 165* 177* 190* err_msg 000106 automatic varying char(200) dcl 73 set ref 105* 106* 110* 124* 134* 149* 163* 176* 183* 189* 196* error_table_$badopt 000040 external static fixed bin(35,0) dcl 83 ref 147 error_table_$noarg 000036 external static fixed bin(35,0) dcl 83 ref 178 expand_path_ 000034 constant entry external dcl 63 ref 187 expecting_ll 000402 automatic bit(1) initial dcl 81 set ref 81* 129 130* 144* 175 given_path 000244 automatic char(168) initial unaligned dcl 76 set ref 76* 157 158* 182 187 187 190 hcs_$initiate_count 000022 constant entry external dcl 59 ref 194 hcs_$terminate_noname 000024 constant entry external dcl 60 ref 97 108 nargs 000104 automatic fixed bin(17,0) dcl 69 set ref 101* 102 121 null builtin function dcl 90 ref 86 97 107 111 195 numeric_arg 000243 automatic fixed bin(17,0) dcl 75 set ref 106* 125* 131* 138* 155* 170 offset 000400 automatic fixed bin(17,0) initial dcl 80 set ref 80* 163 170* 202 203* 204* 207 plen 000403 automatic fixed bin(17,0) dcl 85 set ref 159* 187* ptr builtin function dcl 90 ref 207 segptr 000404 automatic pointer initial dcl 86 set ref 86* 97 97* 107 108* 111* 194* 195 207 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. ioa_ 000000 constant entry external dcl 58 NAMES DECLARED BY EXPLICIT CONTEXT. arg_loop 000411 constant label dcl 121 call_com_err 000254 constant label dcl 106 ref 115 126 150 166 179 191 dgc 000165 constant entry external dcl 11 dump_gcos 000175 constant entry external dcl 11 exit 000312 constant label dcl 107 ref 213 noarg 000672 constant label dcl 178 ref 184 show_expanded_path 000340 constant label dcl 112 ref 197 NAMES DECLARED BY CONTEXT OR IMPLICATION. index builtin function ref 112 112 substr builtin function ref 112 112 141 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 1316 1360 1127 1326 Length 1550 1127 42 153 166 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME dgc 340 external procedure is an external procedure. on unit on line 96 70 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME dgc 000100 argp dgc 000102 argl dgc 000103 argno dgc 000104 nargs dgc 000105 code dgc 000106 err_msg dgc 000171 err_arg dgc 000243 numeric_arg dgc 000244 given_path dgc 000316 dirname dgc 000370 ename dgc 000400 offset dgc 000401 bcdsw dgc 000402 expecting_ll dgc 000403 plen dgc 000404 segptr dgc 000406 bitcount dgc 000410 callptr dgc THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs cat_realloc_cs call_ext_out_desc call_ext_out return enable shorten_stack ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. bcdmp bcdmp$gcdmp bcdmp$set_max_line_len com_err_ cu_$arg_count cu_$arg_ptr cv_dec_check_ cv_oct_check_ expand_path_ hcs_$initiate_count hcs_$terminate_noname THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$badopt error_table_$noarg LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 76 000152 80 000155 81 000156 86 000160 11 000164 96 000203 97 000217 99 000234 101 000235 102 000244 104 000246 105 000247 106 000254 107 000312 108 000316 109 000327 110 000331 111 000336 112 000340 115 000406 118 000410 121 000411 122 000417 123 000434 124 000436 125 000443 126 000445 129 000446 130 000450 131 000451 132 000475 133 000477 134 000500 135 000505 138 000512 139 000521 141 000522 142 000527 144 000543 147 000556 148 000561 149 000564 150 000570 152 000571 155 000572 156 000616 157 000620 158 000624 159 000631 160 000633 163 000634 165 000643 166 000650 168 000651 170 000652 173 000654 175 000656 176 000660 177 000665 178 000672 179 000675 182 000676 183 000702 184 000707 187 000710 188 000735 189 000737 190 000744 191 000747 194 000750 195 001012 196 001016 197 001023 199 001024 201 001025 202 001031 203 001033 204 001075 207 001077 209 001103 211 001115 213 001124 ----------------------------------------------------------- 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