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 / SBC-IMDZ.CZK / SBC-IMDZ.CLK
Text File  |  2000-06-30  |  2KB  |  54 lines

  1. { ROS.CLK - Remote Operating System Clock Routines }
  2.  
  3. { File:        SBC-IMDZ.CLK
  4.   Description: These drivers are designed to support the Teletek System Master
  5.                running under the MDZ multi-user operating system.
  6.   Date:        8/3/85
  7.   Author:      Steve Davis, Sysop of Dragon RCP/M (505)344-3171
  8.  
  9.   Description: Comment update and code cleanup.
  10.   Date:        9/7/85
  11.   Author:      Steve Fox
  12. }
  13.  
  14. procedure DOSCOMMAND; external $F058;
  15.  
  16. procedure GetTAD(var t: tad_array);
  17. { Return a 6 element integer array of the current system time in
  18.   seconds, minutes, hours, day, month, and year. }
  19.   var
  20.     cmdbuffer: array[0..32] of byte;
  21.   begin
  22.     fillchar(cmdbuffer, 33, 0);             { Zero the Command Buffer }
  23.     cmdbuffer[0] := $0C;                    { DOSCOMMAND time of day }
  24.     cmdbuffer[1] := $00;                    { Master to slave get time }
  25.     InLine($11/cmdbuffer);                  { LD DE,address of command buffer }
  26.     DOSCOMMAND;
  27.     t[0] := cmdbuffer[2];                   { seconds }
  28.     t[1] := cmdbuffer[3];                   { minutes }
  29.     t[2] := cmdbuffer[4];                   { hours   }
  30.     t[3] := cmdbuffer[6];                   { day     }
  31.     t[4] := cmdbuffer[7];                   { month   }
  32.     t[5] := cmdbuffer[5]                    { year    }
  33. end;
  34.  
  35. procedure SetTAD(var t: tad_array);
  36. { Set the system time using a 6 element integer array which contains
  37.   seconds, minutes, hours, day, month, and year. }
  38.   var
  39.     cmdbuffer: array[0..32] of byte;
  40.   begin
  41.     fillchar(cmdbuffer, 33, 0);             { Zero the command buffer }
  42.     cmdbuffer[0] := $0C;                    { DOSCOMMAND time of day }
  43.     cmdbuffer[1] := $01;                    { Master to slave set time }
  44.     cmdbuffer[2] := t[0];                   { seconds }
  45.     cmdbuffer[3] := t[1];                   { minutes }
  46.     cmdbuffer[4] := t[2];                   { hours   }
  47.     cmdbuffer[6] := t[3];                   { day     }
  48.     cmdbuffer[7] := t[4];                   { month   }
  49.     cmdbuffer[5] := t[5];                   { year    }
  50.     InLine($11/cmdbuffer);                  { LD DE,address of command buffer }
  51.     DOSCOMMAND
  52. end;
  53.  
  54.