home *** CD-ROM | disk | FTP | other *** search
- { PICS.CLK - Remote Operating System Clock Routines
- Updated 8/24/86 for PICS compatibility by Les Archambault }
-
- { File: COMPTIME.CLK
- Description: This driver set is designed to support the Computime ClockWatch
- with factory default ports.
- Date: 10/1/85
- Author: Larry Alex
- MCI Mail 215-1551
- }
-
- procedure GetTAD(var t: tad_array);
- { Return a 6 element integer array of the current system time in
- seconds, minutes, hours, day, month, and year. }
-
- const
- CDatPort = $81;
- CAddPort = $82;
- var
- i : integer;
- j : integer;
- Time : array [0..12] of byte;
- begin
- port[CDatPort] := 16;
- Delay(1);
- i := 0;
- for j := 44 downto 32 do
- begin
- port[CAddPort] := j;
- Time[i] := port[CAddPort];
- i := i + 1;
- end;
- t[0] := Time[11] * 10 + Time[12];
- t[1] := Time[9] * 10 + Time[10];
- Time[7] := Time[7] - 8;
- t[2] := Time[7] * 10 + Time[8];
- if Time[4] > 3 then
- Time[4] := Time[4] - 4;
- t[3] := Time[4] * 10 + Time[5];
- t[4] := Time[2] * 10 + Time[3];
- t[5] := Time[0] * 10 + Time[1];
- port[CDatPort] := 0;
- end;
-
- procedure SetTAD(var t: tad_array);
- { Set the system time using a 6 element integer array which contains
- seconds, minutes, hours, day, month, and year. NOTE: ClockWatch seconds
- must equal 0 in set routine.}
- const
- CDatPort = $81;
- CAddPort = $82;
- var
- i : integer;
- j : integer;
- Time : array [0..12] of byte;
- begin
- Time[11] := 0;
- Time[12] := 0;
- Time[9] := t[1] div 10;
- Time[10] := t[1] mod 10;
- Time[7] := (t[2] div 10) + 8;
- Time[8] := t[2] mod 10;
- Time[4] := t[3] div 10;
- Time[5] := t[3] mod 10;
- Time[2] := t[4] div 10;
- Time[3] := t[4] mod 10;
- Time[0] := t[5] div 10;
- Time[1] := t[5] mod 10;
- port[CDatPort] := 16;
- Delay(1);
- i := 0;
- for j:= 12 downto 0 do
- begin
- port[CAddPort] := j;
- port[CDatPort] := Time[i] + 16;
- port[CAddPort] := j + 16;
- port[CaddPort] := j;
- i := i + 1;
- end;
- port[CDatPort] := 0;
- end;
-
- {The following two procedures MUST remain here to maintain compatibility
- with systems not using a clock. Please don't remove them.}
-
- Procedure tick_a_min;
- begin
- end;
-
- procedure tick_a_sec;
- begin
- end;