home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / bbs / picssup.ark / NORTC.CLK < prev    next >
Encoding:
Text File  |  1986-10-18  |  1.6 KB  |  52 lines

  1. { PICS.CLK - Remote Operating System Clock Routines
  2.              Updated 8/24/86 for PICS compatibility by Les Archambault }
  3.  
  4. { File:        NORTC.CLK
  5.   Description: This driver set is designed to support computers without a
  6.                real time clock (RTC).  The time and date are maintained in
  7.                'global_date' which is defined in PICSVAR.INC.  It is set to
  8.                00:00:00 initially during PICS initialization.
  9. }
  10.  
  11. procedure GetTAD(var t: tad_array);
  12. { Return a 6 element integer array of the current system time in
  13.   seconds, minutes, hours, day, month, and year. }
  14.   begin
  15.     clock:=false;
  16.     move(global_date, t, 6)
  17.   end;
  18.  
  19. procedure SetTAD(var t: tad_array);
  20. { Set the system time using a 6 element integer array which contains
  21.   seconds, minutes, hours, day, month, and year. }
  22.   begin
  23.     clock:=false;
  24.     move(t, global_date, 6);
  25.     hour_count:=global_date[2]*(600.0*(mhz/4.0));
  26.   end;
  27.  
  28. procedure tick_a_min;
  29. { increments global date if no clock is in use}
  30.   begin
  31.     if global_date[1]<60 then global_date[1]:=succ(global_date[1])
  32.     else
  33.       begin
  34.         global_date[1]:=0;
  35.         if global_date[2]<24 then global_date[2]:=succ(global_date[2])
  36.         else global_date[2]:=0;
  37.       end;
  38.   end;
  39.  
  40. procedure tick_a_sec;
  41. {increments global date if no clock being used}
  42.   begin
  43.     if global_date[0]<60 then global_date[0]:=succ(global_date[0])
  44.     else
  45.       begin
  46.         global_date[0]:=0;
  47.         tick_a_min;
  48.       end;
  49.   end;
  50.  
  51. {end of NORTC.CLK}
  52.