COMPILATION LISTING OF SEGMENT mu_display_descriptor Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/18/85 1043.7 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * * 4* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 5* * * 6* * * 7* *********************************************************** */ 8 9 /* ****************************************************** 10* * * 11* * * 12* * Copyright (c) 1976 by Massachusetts Institute of * 13* * Technology and Honeywell Information Systems, Inc. * 14* * * 15* * * 16* ****************************************************** */ 17 18 /* HISTORY: 19* 20* Written by Jim Gray - - Dec. 1979, to include new data types in 21* MR7 release of PL1 and replace the old mrds_cmdb_alpha_desc with 22* a more general routine. 23* 24* Modified March 25, 1980 by R. Lackey to remove calls to 25* mdbm_util_ 26* 27* 81-09-23 Davids: changed an if statement with a substr reference 28* to an if statement with an index reference to prevent a 29* stringrange condition from occuring if the requested string is 30* larger than the original string. 31**/ 32 33 34 mu_display_descriptor: display_descriptor: procedure (desc_ptr) returns (char (120) varying); 35 36 /* DESCRIPTION: 37* 38* given a pointer to a multics pl1 standard argument descriptor 39* (see subsystem writers guide for format and data types) this 40* routine returns a character string that includes the pl1 keywords 41* attributes that would have appeared in a declaration that 42* produced the given descriptor, plus some clarifying comments, 43* when no keywords are available to describe the data type. for 44* example: if the input pointer pointed to the descriptor 45* "100000110000000000000000000000010001"b then the output would 46* look like "real fixed binary (17,0) unaligned" for an input of 47* "100100110000000000000000000000010001"b the output would be 48* "real fixed decimal (17,0) unaligned /* leading sign 4-bit byte-aligned * /" 49* structures are only displayed as "structure /* 4 elements * /" 50* an array example would be "character (96) varying aligned dimension(1:20,3:-3)" 51* 52* NOTE: the descriptor/array bounds informations is assumed to be 53* in correct format with legal values, no error checking is done in 54* this routine, since this is to be an efficient run-time 55* routine(cmdb should guarantee correctness). 56* 57**/ 58 59 /* PARAMETERS: 60* 61* desc_ptr - - (input) pointer, points to a standard multics pl1 argument 62* descriptor(bit(36) aligned), as described in the subsystem writers guide(under argument list format) 63* if not scalar, the array bounds/multiplier follow the descriptor in consecutive fixed bin(35) words. 64* 65* declaration - - (output) char(120) varying, the declaration of the data type varying, 66* as it would appear after a declare statement that would produce 67* the given descriptor, plus clarifying comments. 68* 69**/ 70 71 /* break down the descriptor into its individual parts */ 72 73 call decode_descriptor_ (desc_ptr, 0, type, unaligned, ndims, size, scale); 74 75 /* set up the return declaration according to the descriptor fields */ 76 77 if type < 1 | type > 63 then 78 declaration = "Unrecognized data type"; 79 else do; 80 81 /* get the basic data type declaration based on the type */ 82 83 declaration = data_type (type); 84 85 if index (declaration, "Unused") = 1 then ; /* CHANGE 81-09-23 ********** */ 86 else do; 87 88 /* go add data type specific information */ 89 90 call add_specifics (); 91 92 /* now add common attribute information, first alignment */ 93 94 if ^new_format_descriptor then ; /* packing info not available in old descriptor */ 95 else do; 96 97 if unaligned then 98 declaration = declaration || " unaligned"; 99 else declaration = declaration || " aligned"; 100 101 end; 102 103 /* now add dimension info, if any */ 104 105 if ndims = 0 then ; 106 else do; 107 108 if ^new_format_descriptor then /* number of dimension unknown in old format */ 109 declaration = declaration || " /* array, old format descriptor */"; 110 else call add_dimension (); 111 112 end; 113 114 /* add on clarifying comments */ 115 116 declaration = declaration || comment (type); 117 118 end; 119 120 end; 121 122 /* report final declaration attributes to caller */ 123 124 return (declaration); 125 126 add_specifics: procedure (); 127 128 /* add precision/scale for numbers, string size for bit/char, or 129* number of elements for a structure */ 130 131 /* numeric types need a precision, scale field attribute */ 132 133 if mu_data_class$number (desc_ptr) then do; /* arithmetic data types */ 134 135 declaration = declaration || " ("; 136 declaration = declaration || ltrim (char (size)); 137 138 if ^mu_data_class$fixed (desc_ptr) then ; /* float types don't have scale */ 139 else do; 140 declaration = declaration || ","; 141 declaration = declaration || ltrim (char (scale)); 142 end; 143 144 declaration = declaration || ")"; 145 146 end; 147 148 /* areas, bit, and character types need a size field */ 149 150 else if type >= 18 & type <= 22 then do; /* area or bit or character */ 151 152 declaration = declaration || " ("; 153 declaration = declaration || ltrim (char (size)); 154 declaration = declaration || ")"; 155 156 /* add the varying/nonvarying attribute for bit or character strings */ 157 158 if type = 20 | type = 22 then 159 declaration = declaration || " varying"; 160 else if type = 19 | type = 21 then 161 declaration = declaration || " nonvarying"; 162 163 end; 164 /* report via a comment, the number of structure elements */ 165 166 else if type = 17 then do; /* structure */ 167 168 if ^new_format_descriptor then ; /* no info on elements in old descriptor */ 169 else do; 170 171 declaration = declaration || " /* "; 172 declaration = declaration || ltrim (char (size)); 173 declaration = declaration || " element"; 174 if size = 1 then 175 declaration = declaration || " */"; 176 else declaration = declaration || "s */"; 177 178 end; 179 180 end; 181 182 end; 183 184 add_dimension: procedure (); 185 186 /* add the dimension attribute, with array bounds */ 187 188 declaration = declaration || " dimension ("; 189 190 /* add a bound_pair "upper:lower" for each dimension */ 191 192 do dimension_number = 1 to ndims; 193 194 offset = (3 * dimension_number) - 2; /* number of words from descriptor to bound */ 195 196 /* pick up bounds words following descriptor */ 197 198 declaration = declaration || ltrim (char (addrel (desc_ptr, offset) -> lower_bound)); 199 declaration = declaration || ":"; 200 declaration = declaration || ltrim (char (addrel (desc_ptr, offset + 1) -> upper_bound)); 201 202 /* add separator or terminator */ 203 204 if dimension_number < ndims then 205 declaration = declaration || ","; 206 else declaration = declaration || ")"; 207 208 end; 209 210 end; 211 212 dcl desc_ptr ptr; /* pointer to Multics descriptor (input) */ 213 214 declare declaration char (120) varying;/* This variable used to build return declaration */ 215 declare type fixed bin; /* descriptor type */ 216 declare unaligned bit (1) aligned; /* indicates unaligned ("1"b) or aligned ("0"b) */ 217 declare ndims fixed bin; /* number dimensions ; must be zero for dbm version 1 */ 218 declare size fixed bin; /* char string size or arithmetic precision */ 219 declare scale fixed bin; /* arithmetic scale factor */ 220 221 declare data_type (1:63) char (28) varying internal static options (constant) initial ( 222 "real fixed binary", "real fixed binary", "real float binary", "real float binary", /* 1 - 4 */ 223 "complex fixed binary", "complex fixed binary", "complex float binary", "complex float binary", /* 5 - 8 */ 224 "real fixed decimal", "real float decimal", "complex fixed decimal", "complex float decimal", /* 9 - 12 */ 225 "pointer", "offset", "label", "entry", /* 13 - 16 */ 226 "structure", "area", "bit", "bit", /* 17 - 20 */ 227 "character", "character", "file", /* 21 - 23 */ 228 (5) ("Unused data type"), /* 24 - 28 */ 229 (2) ("real fixed decimal"), /* 29 - 30 */ 230 (2) ("Unused data type"), /* 31 - 32 */ 231 (2) ("real unsigned fixed binary"), /* 33 - 34 */ 232 "real unsigned fixed decimal", /* 35 */ 233 "real fixed decimal", /* 36 */ 234 "Unused data type",/* 37 */ 235 "real unsigned fixed decimal", /* 38 */ 236 "real fixed decimal", /* 39 */ 237 "Unused data type",/* 40 */ 238 (2) ("real fixed decimal", "real float decimal"), /* 41 - 44 */ 239 "complex fixed decimal", "complex float decimal", /* 45 - 46 */ 240 (17) ("Unused data type")); /* 47 - 63 */ 241 242 declare comment (1:63) char (40) varying internal static options (constant) initial ( 243 (8) (""), /* 1 - 8 */ 244 (2) (" /* leading sign 9-bit */", " /* 9-bit */"), /* 9 - 12 */ 245 (16) (""), /* 13 - 28 */ 246 " /* leading overpunched sign 9-bit */", /* 29 */ 247 " /* trailing overpunched sign 9-bit */", /* 30 */ 248 (4) (""), /* 31 - 34 */ 249 " /* 9-bit */", /* 35 */ 250 " /* trailing sign 9-bit */", /* 36 */ 251 "", " /* 4-bit */",/* 37 - 38 */ 252 " /* trailing sign 4-bit */", /* 39 */ 253 "", " /* leading sign 4-bit */", " /* 4-bit */", /* 40 - 42 */ 254 " /* leading sign 4-bit byte-aligned */", /* 43 */ 255 " /* 4-bit byte-aligned */", /* 44 */ 256 " /* leading sign 4-bit byte-aligned */", /* 45 */ 257 " /* 4-bit byte-aligned */", /* 46 */ 258 (17) ("")); /* 47 - 63 */ 259 260 declare (ltrim, index, addrel, char) builtin; 261 declare decode_descriptor_ entry (ptr, fixed bin, fixed bin, bit (1) aligned, fixed bin, fixed bin, fixed bin); 262 declare new_format_descriptor bit (1) unal based (desc_ptr); /* version bit of descriptor is first */ 263 declare dimension_number fixed bin; /* number of current dimension */ 264 declare offset fixed bin; /* number of words past desc_ptr, to get array bound */ 265 declare (lower_bound, upper_bound) fixed bin (35) based; /* overlays for array bound info */ 266 declare (mu_data_class$number, 267 mu_data_class$fixed) entry (ptr) returns (bit (1) aligned); /* decides if data in entries class */ 268 269 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/18/85 0908.2 mu_display_descriptor.pl1 >special_ldd>online>mrds.pbf-04/18/85>mu_display_descriptor.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. addrel builtin function dcl 260 ref 198 200 char builtin function dcl 260 ref 136 141 153 172 198 200 comment 000000 constant varying char(40) initial array dcl 242 ref 116 data_type 001265 constant varying char(28) initial array dcl 221 ref 83 declaration 000100 automatic varying char(120) dcl 214 set ref 77* 83* 85 97* 97 99* 99 108* 108 116* 116 124 135* 135 136* 136 140* 140 141* 141 144* 144 152* 152 153* 153 154* 154 158* 158 160* 160 171* 171 172* 172 173* 173 174* 174 176* 176 188* 188 198* 198 199* 199 200* 200 204* 204 206* 206 decode_descriptor_ 000010 constant entry external dcl 261 ref 73 desc_ptr parameter pointer dcl 212 set ref 34 34 73* 94 108 133* 138* 168 198 200 dimension_number 000144 automatic fixed bin(17,0) dcl 263 set ref 192* 194 204* index builtin function dcl 260 ref 85 lower_bound based fixed bin(35,0) dcl 265 ref 198 ltrim builtin function dcl 260 ref 136 141 153 172 198 200 mu_data_class$fixed 000014 constant entry external dcl 266 ref 138 mu_data_class$number 000012 constant entry external dcl 266 ref 133 ndims 000141 automatic fixed bin(17,0) dcl 217 set ref 73* 105 192 204 new_format_descriptor based bit(1) unaligned dcl 262 ref 94 108 168 offset 000145 automatic fixed bin(17,0) dcl 264 set ref 194* 198 200 scale 000143 automatic fixed bin(17,0) dcl 219 set ref 73* 141 size 000142 automatic fixed bin(17,0) dcl 218 set ref 73* 136 153 172 174 type 000137 automatic fixed bin(17,0) dcl 215 set ref 73* 77 77 83 116 150 150 158 158 160 160 166 unaligned 000140 automatic bit(1) dcl 216 set ref 73* 97 upper_bound based fixed bin(35,0) dcl 265 ref 200 NAMES DECLARED BY EXPLICIT CONTEXT. add_dimension 003157 constant entry internal dcl 184 ref 110 add_specifics 002536 constant entry internal dcl 126 ref 90 display_descriptor 002326 constant entry external dcl 34 mu_display_descriptor 002336 constant entry external dcl 34 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 3440 3456 3352 3450 Length 3640 3352 16 146 65 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME display_descriptor 152 external procedure is an external procedure. add_specifics internal procedure shares stack frame of external procedure display_descriptor. add_dimension internal procedure shares stack frame of external procedure display_descriptor. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME display_descriptor 000100 declaration display_descriptor 000137 type display_descriptor 000140 unaligned display_descriptor 000141 ndims display_descriptor 000142 size display_descriptor 000143 scale display_descriptor 000144 dimension_number display_descriptor 000145 offset display_descriptor THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return ext_entry set_cs_eis index_cs_eis THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. decode_descriptor_ mu_data_class$fixed mu_data_class$number NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 34 002322 73 002343 77 002367 83 002402 85 002412 90 002423 94 002424 97 002437 99 002455 105 002467 108 002472 110 002507 116 002510 124 002526 126 002536 133 002537 135 002554 136 002566 138 002622 140 002640 141 002647 144 002703 146 002712 150 002713 152 002720 153 002732 154 002766 158 002775 160 003015 163 003033 166 003034 168 003036 171 003046 172 003060 173 003114 174 003126 176 003144 182 003156 184 003157 188 003160 192 003172 194 003201 198 003204 199 003244 200 003253 204 003314 206 003327 208 003336 210 003340 ----------------------------------------------------------- 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