cdc:nos2.source:nam5871:dluptm
Table of Contents
DLUPTM
Table Of Contents
- [00003] PROC DLUPTM(CLOCK$TIME,ELAPSED, RETRN)
Source Code
- DLUPTM.txt
- *DECK DLUPTM
- USETEXT DLFPDEF
- PROC DLUPTM(CLOCK$TIME,ELAPSED, RETRN);# CALCULATE CLOCK TIME FROM OFFS#
- *IF DEF,IMS
- #
- *1DC DLUPTM
- *
- * 1. PROC NAME AUTHOR DATE
- * DLUPTM P.C.TAM 78/10/05
- *
- * 2. FUNCTIONAL DESCRIPTION.
- * CALCULATE CLOCK TIME.
- *
- * 3. METHOD USED.
- * CONVERT DISPLAY CLOCK TIME TO BINARY,
- * ADD IN ELAPSED TIME,
- * CONVERT BACK TO DISPLAY.
- *
- * 4. ENTRY PARAMETERS.
- * CLOCK$TIME CLOCK TIME IN DISPLAY CODE
- * ELAPSED OFFSET ADDED
- *
- * 5. EXIT PARAMETERS.
- * RETRN CALCULATED CLOCK TIME
- *
- * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
- * DLFPDEF
- *
- * 7. ROUTINES CALLED.
- * NONE.
- *
- #
- *ENDIF
- #
- EXTERNAL VARIABLES
- #
- #
- INTERNAL VARIABLES
- #
- ARRAY CLOCK$TIME S(1);
- BEGIN
- ITEM HOUR U(0,6,12); # HOUR FIELD #
- ITEM HOUR1 U(0,6,CL); # 1ST DIGIT OF HOUR FIELD #
- ITEM HOUR2 U(0,12,CL); # 2ND DIGIT OF HOUR FIELD #
- ITEM MINUTE U(0,24,12); # MINUTE FIELD #
- ITEM MIN1 U(0,24,CL); # 1ST DIGIT OF MINUTE FIELD #
- ITEM MIN2 U(0,30,CL); # 2ND DIGIT OF MINUTE FILED #
- ITEM SECS U(0,42,12); # SECONDS FIELD #
- ITEM SEC1 U(0,42,CL); # 1ST DIGIT OF SECOND FIELD #
- ITEM SEC2 U(0,48,CL); # 2ND DIGIT OF SECOND FIELD #
- END
- ITEM
- ELAPSED I, # OFFSET TO ADD #
- RETRN C(WC), # RETURN RESULT #
- HH I, # TEMP VARIABLE TO HOLD HOUR FIELD #
- MM I, # TEMP VARIABLE TO HOLD MINUTE FIELD #
- SS I, # TEMP VARIABLE TO HOLD SECOND FIELD #
- TEMP1 I, # TEMPORARY VARIABLE #
- TEMP2 I; # TEMPORARY VARIABLE #
- # ******************************************************************** #
- BEGIN
- #
- CALCULATE BINARY HOUR, MINUTE, SECOND.
- #
- HH = 10 * (HOUR1[0] - O"33") + (HOUR2[0] - O"33");
- MM = 10 * (MIN1[0] - O"33") + (MIN2[0] - O"33");
- SS = 10 * (SEC1[0] - O"33") + (SEC2[0] - O"33");
- #
- ADD IN OFFSET
- #
- TEMP1 = SS + ELAPSED;
- TEMP2 = TEMP1 / 60;
- SS = TEMP1 - TEMP2 * 60;
- TEMP1 = MM + TEMP2;
- TEMP2 = TEMP1 / 60;
- MM = TEMP1 - TEMP2 * 60;
- TEMP1 = HH + TEMP2;
- TEMP2 = TEMP1 / 24;
- HH = TEMP1 - TEMP2 * 24;
- #
- CONVERT TO DISPLAY CODE
- #
- RETRN = " . . .";
- TEMP1 = HH / 10;
- B<0, CL> RETRN = TEMP1 + O"33";
- B<6, CL> RETRN = (HH - TEMP1 * 10) + O"33";
- TEMP1 = MM / 10;
- B<18, CL> RETRN = TEMP1 + O"33";
- B<24, CL> RETRN = (MM - TEMP1 * 10) + O"33";
- TEMP1 = SS / 10;
- B<36, CL> RETRN = TEMP1 + O"33";
- B<42, CL> RETRN = (SS - TEMP1 * 10) + O"33";
- END
- TERM
cdc/nos2.source/nam5871/dluptm.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator