home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
ZCAT
/
ROS-CLK.LBR
/
LEGACY.CZK
/
LEGACY.CLK
Wrap
Text File
|
2000-06-30
|
2KB
|
61 lines
{ ROS.CLK - Remote Operating System Clock Routines }
{ File: LEGACY.CLK
Description: This driver set is designed to support the Legacy clock for
a Kaypro 10 (should work with other Kaypro machines as well).
Date: 5/4/85
Author: Chris DeBracy
Description: Comment update and code cleanup.
Date: 9/7/85
Author: Steve Fox
}
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
z1 = $79;
z2 = $7B;
var
i: integer;
temp: array[0..4] of integer;
tar: array[0..12] of integer;
begin
for i := 0 to 12 do
begin
port[z1] := 0;
port[z2] := $CF;
port[z2] := 0;
port[z1] := i;
port[z1] := i + 128;
port[z1] := i;
port[z1] := $20; { set input mode }
port[z2] := $CF;
port[z2] := $0F;
port[z1] := $20;
tar[i] := port[z1] and $0F { read data }
end;
val(chr(tar[1] + 48) + chr(tar[0] + 48), temp[0], i);
val(chr(tar[3] + 48) + chr(tar[2] + 48), temp[1], i);
val(chr(tar[5] + 48) + chr(tar[4] + 48), temp[2], i);
val(chr(tar[8] + 48) + chr(tar[7] + 48), temp[3], i);
val(chr(tar[10] + 48) + chr(tar[9] + 48), temp[4], i);
for i := 0 to 4 do
t[i] := temp[i];
t[5] := 85
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. }
begin
mem[$FF7C] := t[0];
mem[$FF7D] := t[1];
mem[$FF7E] := t[2];
mem[$FF7F] := pred(t[3]);
mem[$FF80] := pred(t[4]);
mem[$FF81] := t[5]
end;