COMPILATION LISTING OF SEGMENT meter_format_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1608.2 mst Mon 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 /* format: style4,delnl,insnl,^ifthendo */ 12 meter_format_: 13 procedure; 14 15 /* collection of routines to return nicely formatted numbers for metering commands */ 16 17 /* PARAMETERS */ 18 19 dcl number fixed bin (35); 20 dcl width fixed bin; 21 dcl dividend fixed bin (71); 22 dcl divisor fixed bin (71); 23 dcl format char (*); 24 dcl interval fixed bin (71); 25 26 /* AUTOMATIC */ 27 28 dcl picture pic "zzz,zzz,zzz,zz9"; 29 dcl result char (15) varying; 30 dcl qresult float bin (27); 31 dcl retval char (12) varying; 32 dcl hours pic "zzz9"; 33 dcl minutes pic "99"; 34 dcl seconds pic "99"; 35 dcl all_seconds fixed bin (35); 36 37 38 /* ENTRIES */ 39 40 dcl ioa_$rsnnl entry options (variable); 41 42 43 /* BUILTINS & CONDITIONS */ 44 45 dcl (size, zerodivide) condition; 46 47 dcl (divide, ltrim, copy, max, length, float) builtin; 48 49 picture: 50 entry (number, width) returns (char (15) varying); 51 52 /* a function that, given a fixed bin number, returns it with commas, right-justified in a field of a given width */ 53 54 picture = number; /* this does the magic conversion */ 55 result = ltrim (picture); /* get rid of leading blanks */ 56 /* and then restore the right number of them */ 57 return (copy (" ", max (0, width - length (result))) || result); 58 59 quotient: 60 entry (dividend, divisor, format) returns (char (12) varying); 61 62 /* a function that divides 2 fixed bins to get a floating result, and then returns it formatted as specified. 63* Returns a nice character string in case of division by 0. */ 64 65 on zerodivide go to quotient_error; 66 67 qresult = float (dividend) / float (divisor); 68 call ioa_$rsnnl (format, retval, (0), qresult); 69 return (retval); 70 71 quotient_error: 72 return ("No data."); 73 74 time: 75 entry (interval) returns (char (10)); 76 77 /* a function that, given a time interval in microseconds, returns it in character 78* string form as hours:minutes:seconds */ 79 80 on size go to time_error; 81 all_seconds = divide (interval, 1000000, 35, 0); /* elapsed time in seconds */ 82 hours = divide (all_seconds, 3600, 35, 0); 83 minutes = divide (all_seconds, 60, 35, 0) - 60 * hours; 84 /* residual minutes */ 85 seconds = all_seconds - 3600 * hours - 60 * minutes; /* residual seconds */ 86 return (hours || ":" || minutes || ":" || seconds); 87 88 time_error: 89 return ("No data."); 90 91 end meter_format_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1459.8 meter_format_.pl1 >dumps>old>recomp>meter_format_.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. all_seconds 000121 automatic fixed bin(35,0) dcl 35 set ref 81* 82 83 85 copy builtin function dcl 47 ref 57 divide builtin function dcl 47 ref 81 82 83 dividend parameter fixed bin(71,0) dcl 21 ref 59 67 divisor parameter fixed bin(71,0) dcl 22 ref 59 67 float builtin function dcl 47 ref 67 67 format parameter char unaligned dcl 23 set ref 59 68* hours 000116 automatic picture(4) unaligned dcl 32 set ref 82* 83 85 86 interval parameter fixed bin(71,0) dcl 24 ref 74 81 ioa_$rsnnl 000010 constant entry external dcl 40 ref 68 length builtin function dcl 47 ref 57 ltrim builtin function dcl 47 ref 55 max builtin function dcl 47 ref 57 minutes 000117 automatic picture(2) unaligned dcl 33 set ref 83* 85 86 number parameter fixed bin(35,0) dcl 19 ref 49 54 picture 000100 automatic picture(15) unaligned dcl 28 set ref 54* 55 qresult 000111 automatic float bin(27) dcl 30 set ref 67* 68* result 000104 automatic varying char(15) dcl 29 set ref 55* 57 57 retval 000112 automatic varying char(12) dcl 31 set ref 68* 69 seconds 000120 automatic picture(2) unaligned dcl 34 set ref 85* 86 size 000122 stack reference condition dcl 45 ref 80 width parameter fixed bin(17,0) dcl 20 ref 49 57 zerodivide 000130 stack reference condition dcl 45 ref 65 NAMES DECLARED BY EXPLICIT CONTEXT. meter_format_ 000032 constant entry external dcl 12 picture 000046 constant entry external dcl 49 quotient 000202 constant entry external dcl 59 quotient_error 000340 constant label dcl 71 ref 65 time 000404 constant entry external dcl 74 time_error 000632 constant label dcl 88 ref 80 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 776 1010 705 1006 Length 1162 705 12 136 70 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME meter_format_ 125 external procedure is an external procedure. on unit on line 65 64 on unit on unit on line 80 64 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME meter_format_ 000100 picture meter_format_ 000104 result meter_format_ 000111 qresult meter_format_ 000112 retval meter_format_ 000116 hours meter_format_ 000117 minutes meter_format_ 000120 seconds meter_format_ 000121 all_seconds meter_format_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs cat_realloc_cs call_ext_out_desc return tra_ext signal enable ext_entry ext_entry_desc int_entry unpack_pic divide_fx3 THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. ioa_$rsnnl NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 12 000031 49 000041 54 000055 55 000066 57 000107 59 000175 65 000217 67 000236 68 000250 69 000277 71 000340 74 000400 80 000412 81 000431 82 000437 83 000450 85 000504 86 000547 88 000632 ----------------------------------------------------------- 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