COMPILATION LISTING OF SEGMENT cmcs_date_time_ Compiled by: Multics PL/I Compiler, Release 31b, of April 24, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 05/24/89 1023.9 mst Wed Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) BULL HN Information Systems Inc., 1989 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 6* * * 7* *********************************************************** */ 8 9 10 11 12 /****^ HISTORY COMMENTS: 13* 1) change(89-04-23,Zimmerman), approve(89-04-23,MCR8060), 14* audit(89-05-05,RWaters), install(89-05-24,MR12.3-1048): 15* MCR8060 cmcs_date_time_.pl1 Reformatted code to new Cobol standard. 16* END HISTORY COMMENTS */ 17 18 19 /* Modified since Version 4.3 */ 20 21 /* format: style3 */ 22 cmcs_date_time_: 23 proc (a_clock_value, a_date, a_time); 24 25 dcl a_clock_value fixed bin (71), 26 a_date char (6) unaligned, 27 a_time char (8) unaligned; 28 29 /* 30* This COBOL MCS procedure accepts a clock_ value as input and 31* returns strings of form YYMMDD and HHMMSSTT, where 32* YY is year 33* MM is month 34* DD is day 35* and, 36* HH is hour 37* MM is minute 38* SS is second 39* TT is hundredths of a second 40* 41* It is directly adapted from the pl1_date_ and pl1_time_ subroutines, the difference being 42* that the clock_ value is externally supplied and is used in both the date and time computations. 43* 44* Bob May, 6/30/77 45* */ 46 47 dcl clock_value fixed bin (71); /* copy because we modify it */ 48 49 dcl sys_info$time_delta fixed bin ext, 50 (date, day, month, year, i) 51 fixed bin; 52 53 dcl clk float bin (63), 54 (seconds, microseconds) 55 fixed bin, 56 digit (0:9) char (1) aligned static init ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); 57 58 dcl (divide, min, mod, substr) 59 builtin; 60 61 /* */ 62 63 dcl table (6) fixed bin (6) static init (10, 10, 6, 10, 6, 10); 64 65 clock_value = a_clock_value + 5000; /* round up to hundredths of a second, we'll truncate later */ 66 67 date = (clock_value - sys_info$time_delta) / 8.64e10 + 694266; 68 /* days from 3-1-0000 */ 69 70 day = mod (date, 146097); /* days into 400 year cycle */ 71 72 year = 400 * divide (date, 146097, 35, 0); /* year set to beginning of cycle */ 73 74 date = 3 + 4 * (day + min (3, divide (date, 36534, 17, 0))); 75 /* prepare year estimator */ 76 77 day = mod (date, 1461); /* day = 4 * day_of_year (0 ... 365) */ 78 79 year = year + divide (date, 1461, 17, 0); /* add in year of cycle */ 80 81 date = 2 + 5 * divide (day, 4, 17, 0); /* prepare month estimator */ 82 83 day = mod (date, 153); /* day = 5 * day_of_month (0 ... 30) */ 84 85 month = 1 + mod (2 + divide (date, 153, 17, 0), 12); 86 /* get month */ 87 88 if month < 3 89 then year = year + 1; /* correct for jan, feb */ 90 91 day = 1 + divide (day, 5, 17, 0); /* get day */ 92 93 date = year * 10000 + month * 100 + day; 94 95 do i = 6 by -1 to 1; 96 substr (a_date, i, 1) = digit (mod (date, 10)); 97 date = divide (date, 10, 35, 0); 98 end; 99 100 clk = mod (clock_value - sys_info$time_delta, 8.64e10); 101 102 seconds = clk / 1.e6; 103 microseconds = clk - seconds * 1.e6; 104 seconds = mod (seconds, 86400); 105 106 107 microseconds = microseconds / 10000.0; /* convert microseconds to hundredths of a second */ 108 109 do i = 8 by -1 to 7; 110 substr (a_time, i, 1) = digit (mod (microseconds, 10)); 111 microseconds = divide (microseconds, 10, 35, 0); 112 end; 113 114 do while (i > 0); 115 substr (a_time, i, 1) = digit (mod (seconds, table (i))); 116 seconds = divide (seconds, table (i), 35, 0); 117 i = i - 1; 118 end; 119 120 return; 121 122 end /* cmcs_date_time_ */; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 05/24/89 0836.7 cmcs_date_time_.pl1 >spec>install>MR12.3-1048>cmcs_date_time_.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_clock_value parameter fixed bin(71,0) dcl 25 ref 22 65 a_date parameter char(6) packed unaligned dcl 25 set ref 22 96* a_time parameter char(8) packed unaligned dcl 25 set ref 22 110* 115* clk 000110 automatic float bin(63) dcl 53 set ref 100* 102 103 clock_value 000100 automatic fixed bin(71,0) dcl 47 set ref 65* 67 100 date 000102 automatic fixed bin(17,0) dcl 49 set ref 67* 70 72 74* 74 77 79 81* 83 85 93* 96 97* 97 day 000103 automatic fixed bin(17,0) dcl 49 set ref 70* 74 77* 81 83* 91* 91 93 digit 000006 constant char(1) initial array dcl 53 ref 96 110 115 divide builtin function dcl 58 ref 72 74 79 81 85 91 97 111 116 i 000106 automatic fixed bin(17,0) dcl 49 set ref 95* 96* 109* 110* 114 115 115 116 117* 117 microseconds 000113 automatic fixed bin(17,0) dcl 53 set ref 103* 107* 107 110 111* 111 min builtin function dcl 58 ref 74 mod builtin function dcl 58 ref 70 77 83 85 96 100 104 110 115 month 000104 automatic fixed bin(17,0) dcl 49 set ref 85* 88 93 seconds 000112 automatic fixed bin(17,0) dcl 53 set ref 102* 103 104* 104 115 116* 116 substr builtin function dcl 58 set ref 96* 110* 115* sys_info$time_delta 000010 external static fixed bin(17,0) dcl 49 ref 67 100 table 000000 constant fixed bin(6,0) initial array dcl 63 ref 115 116 year 000105 automatic fixed bin(17,0) dcl 49 set ref 72* 79* 79 88* 88 93 NAME DECLARED BY EXPLICIT CONTEXT. cmcs_date_time_ 000032 constant entry external dcl 22 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 350 362 311 360 Length 532 311 12 133 36 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cmcs_date_time_ 79 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cmcs_date_time_ 000100 clock_value cmcs_date_time_ 000102 date cmcs_date_time_ 000103 day cmcs_date_time_ 000104 month cmcs_date_time_ 000105 year cmcs_date_time_ 000106 i cmcs_date_time_ 000110 clk cmcs_date_time_ 000112 seconds cmcs_date_time_ 000113 microseconds cmcs_date_time_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. fx1_to_fl2 return_mac fl2_to_fx1 mdfl2 mdfx1 ext_entry trunc_fx2 divide_fx1 NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. sys_info$time_delta LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 22 000026 65 000037 67 000043 70 000056 72 000061 74 000065 77 000076 79 000101 81 000104 83 000111 85 000114 88 000123 91 000126 93 000132 95 000142 96 000147 97 000161 98 000164 100 000167 102 000200 103 000204 104 000212 107 000216 109 000225 110 000233 111 000245 112 000250 114 000253 115 000256 116 000270 117 000273 118 000275 120 000276 ----------------------------------------------------------- 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