home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1994 February / psl_9403.zip / psl_9403 / DOS / UT_SYSTM / CLOCK.ZIP / CLOCK.DOC < prev    next >
Text File  |  1993-11-19  |  192KB  |  5,611 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.           CLOCK Version 3.52                              November 19, 1993
  9.  
  10.  
  11.  
  12.  
  13.                                      Version 3.52
  14.  
  15.  
  16.  
  17.  
  18.                             CLOCK is a shareware program.
  19.                      See Appendix A for registration information.
  20.                           $10 (or $25 for full source code)
  21.  
  22.                                    Ronald Q. Smith
  23.                                   11 Black Oak Road
  24.                                St. Paul, MN 55127-6204
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.                        (c) Copyright 1991-1993 Ronald Q. Smith
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.           CLOCK Version 3.52                              November 19, 1993
  75.  
  76.  
  77.                                        CONTENTS
  78.  
  79.  
  80.  
  81.           I.  INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . .   1
  82.  
  83.           APPENDIX A:  DEFINITION OF SHAREWARE  . . . . . . . . . . . .  62
  84.  
  85.           APPENDIX B:  CLOCK TYPES  . . . . . . . . . . . . . . . . . .  65
  86.                B.1  Type 0 - PC/AT  . . . . . . . . . . . . . . . . . .  65
  87.  
  88.                B.2  Type 1 - Zenith Z-18x portables, Supersport 20  . .  66
  89.                B.3  Type 2 - Various Zenith Data System PCs.  . . . . .  66
  90.                B.4  Type 3 - Memory-Mapped Clocks . . . . . . . . . . .  67
  91.                B.5  Type 4 - Direct Register I/O Bus Clock  . . . . . .  68
  92.                B.6  Type 5 - Mitsubishi 8088 PCs  . . . . . . . . . . .  70
  93.                B.7  Type 6 - Indirect Register I/O Bus Clock  . . . . .  71
  94.  
  95.                B.8  Type 7 - Complex I/O Bus Clock  . . . . . . . . . .  72
  96.                B.9  Type 8 - Generic I/O Bus Clock  . . . . . . . . . .  73
  97.                B.10 Type 9 - Quadram I/O Bus Clock  . . . . . . . . . .  74
  98.                B.11 Type A - AT&T 6300, 6300 PLUS, 6300 WGS . . . . . .  75
  99.                B.12 Type B - Hyundai 8088 Clock . . . . . . . . . . . .  76
  100.                B.13 Type C - Multi I/O Card Clock . . . . . . . . . . .  76
  101.  
  102.  
  103.           APPENDIX C:  REVISION HISTORY . . . . . . . . . . . . . . . .  78
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.           CLOCK Version 3.52                              November 19, 1993
  141.  
  142.  
  143.           I.  INTRODUCTION
  144.           A.DefinitionsYour PC  contains  two  clocks.   One  of  these  is
  145.           referred  to in  this document  and in messages  from CLK  as the
  146.  
  147.           "calendar clock."  The other is referred to as the "DOS clock."
  148.  
  149.           CALENDAR CLOCK
  150.  
  151.                The  calendar clock is the  clock that retains  the date and
  152.                time when your system is turned  off.  It is the clock  that
  153.  
  154.                requires  a battery and  for that reason  is also called the
  155.                battery-protected  clock.    Various  hardware vendors  also
  156.                refer to it as the real-time clock, the  CMOS clock, and the
  157.                day clock.   In most  systems it is  a bit of  logic on  the
  158.                motherboard or other  add-in board and  consists of a  clock
  159.                chip, a  battery, and some control logic.  Some older clocks
  160.  
  161.                are on  little  mini-boards that  plug into  a cable  (e.g.,
  162.                floppy cable) or socket under another chip.
  163.  
  164.                The calendar clock typically has  a set of internal counters
  165.                that maintain the  seconds, minutes, hours, day of week, day
  166.                of month, month, and year.  Some don't allow  you to set the
  167.  
  168.                seconds and can  only be set on the minute  even though they
  169.                may allow  you  to read  the seconds.   Many  of them  don't
  170.                maintain the year.  They expect the software to  simply keep
  171.                the year up to date by writing it to the chip every time you
  172.                boot.  Some of the  calendar clocks don't handle leap years.
  173.                CLOCK.SYS  will  handle the  leap  years  for you  on  those
  174.  
  175.                clocks.
  176.  
  177.                The calendar clock is normally read once  when the system is
  178.                booted and  the time is then written to  the DOS clock.  The
  179.                calendar clock is  then normally never read again, but it is
  180.                written if you change the time.  Since the calendar clock is
  181.  
  182.                usually substantially more accurate  than the DOS clock, one
  183.                of the  functions that CLOCK.SYS can  perform for you  is to
  184.                periodically read  the  calendar  clock and  reset  the  DOS
  185.                clock.
  186.  
  187.           DOS CLOCK
  188.  
  189.  
  190.                The DOS clock is really not a clock although it is used like
  191.                one.  It is really just a counter that increments at a known
  192.                rate (18.2 times per  second).  The DOS clock is also called
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.           CLOCK Version 3.52                              November 19, 1993
  207.  
  208.  
  209.                the  BIOS clock,  the interval  timer, and  the incrementing
  210.                counter.
  211.  
  212.  
  213.                When  you  boot  the  system,  your  clock  driver  software
  214.                (CLOCK.SYS, the  driver built  into DOS,  or another  add-in
  215.                software driver)  reads the calendar clock  and converts the
  216.                date  and time to the number  of days since January 1, 1980,
  217.                and the number of seconds since midnight on the current day.
  218.                The number  of days is  just saved inside the  clock driver.
  219.  
  220.                The  number of seconds  is converted to  a number of counter
  221.                ticks  using a  little more  exact  number than  18.2.   The
  222.                number of ticks is then stored in the counter by calling the
  223.                BIOS.
  224.  
  225.                When you  ask DOS  to read  the clock,  it  calls the  clock
  226.  
  227.                driver which reads the counter by calling the BIOS, converts
  228.                the number of ticks back to seconds, and  returns the number
  229.                of days that it has saved  and the number of seconds to DOS.
  230.                The BIOS  checks to see  if the counter goes  past midnight.
  231.                If it does, it resets the counter to zero and tells the next
  232.                caller that the day  has advanced.  In  that case the  clock
  233.  
  234.                driver increments the day that is has saved before returning
  235.                it to DOS.
  236.  
  237.                Unfortunately, the  BIOS only  tells the first  caller after
  238.                midnight  that the  day has  advanced.   That is  the common
  239.                reason for the  day not advancing on your PC  when you leave
  240.  
  241.                an application running over midnight.  Many applications use
  242.                the  BIOS counter  internally  just to  get  interval timing
  243.                information.  When they do, DOS doesn't see that the day has
  244.                advanced.   This is  another problem that  CLOCK.SYS solves.
  245.                It  checks to see if the time  ever appears to run backwards
  246.                and increments the day if it does.
  247.  
  248.           B.OverviewCLOCK consists  of two programs that  give you complete
  249.           control over the  operation of your  calendar (battery-protected)
  250.           clock and your DOS/BIOS  internal timer.  The normal  DOS mode of
  251.           operation is to  read the calendar clock when you boot the system
  252.           and set the internal timer.  Thereafter all read operations refer
  253.           only to the internal timer while time setting operations write to
  254.  
  255.           both clocks.  In  levels of DOS prior  to 3.3, even time  setting
  256.           operations only wrote to the internal timer.  In order to set the
  257.           calendar clock you had to run the SETUP program.
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.           CLOCK Version 3.52                              November 19, 1993
  273.  
  274.  
  275.           Some of the drawbacks  to the standard  DOS clock operation  that
  276.           the CLOCK programs address are:
  277.  
  278.  
  279.                ∙    There is  no  provision to  switch  time zones  without
  280.                     resetting the system time.
  281.  
  282.                ∙    DOS  does not handle automatic changes between daylight
  283.                     savings time and standard time.
  284.  
  285.  
  286.                ∙    The DOS/BIOS internal timer often drifts quite  rapidly
  287.                     away  from  the time  maintained  by the  more accurate
  288.                     calendar clock.
  289.  
  290.                ∙    Even  the calendar  clock drifts  slowly away  from the
  291.                     accurate  time.  DOS  provides no way  to automatically
  292.  
  293.                     adjust for that drift.
  294.  
  295.                ∙    If your  battery is failing  or some other  hardware or
  296.                     software problem messes  up the  time in your  calendar
  297.                     clock, there is no way to detect that except by manual-
  298.                     ly displaying the time and checking it.
  299.  
  300.  
  301.                ∙    If you have to run a program that occasionally  changes
  302.                     the  time incorrectly, there is no  way to protect your
  303.                     clock from  those  changes.   You  can also  have  this
  304.                     problem  if  you are  a parent  whose children  set the
  305.                     clock when you don't want  them to, an instructor whose
  306.  
  307.                     students reset the time, or  an expert young user whose
  308.                     parents mess up your clock.
  309.  
  310.                ∙    If  you need to experiment with special times and dates
  311.                     but don't want to have to reset your clock  afterwards,
  312.                     DOS has no mechanism to help.  In order to test end-of-
  313.  
  314.                     month processing for your  application, you have to set
  315.                     the  date and time,  run your  tests, and then  set the
  316.                     time and date back.
  317.  
  318.                ∙    The standard DOS and BIOS software on some PCs can miss
  319.                     the change  to a new  day when the  PC is left  on over
  320.  
  321.                     midnight.
  322.  
  323.                ∙    Your clock might not handle automatic changes to  a new
  324.                     year or may not understand leap years.
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.           CLOCK Version 3.52                              November 19, 1993
  339.  
  340.  
  341.                ∙    You may have an  older PC from  before the PC/AT  clock
  342.                     standardization and your vendor no  longer releases new
  343.                     versions of DOS  for that PC.  You are stuck on DOS 3.2
  344.  
  345.                     or earlier or you have to give up your calendar clock.
  346.  
  347.  
  348.           If  any of those circumstances cause  problems for you, CLOCK can
  349.           help.  The two  primary programs are  CLOCK.SYS and CLK.EXE.   In
  350.           addition, if you are a software developer, CLKDEMO is provided in
  351.  
  352.           source code to show  you how to program the extended clock opera-
  353.           tions into your own applications.
  354.  
  355.  
  356.                CLOCK.SYS is a clock device driver (CLOCK$ device).  It
  357.                replaces the DOS internal clock driver.  CLOCK.SYS pro-
  358.  
  359.                vides  for  automatic time  zone conversion.    It also
  360.                allows you to periodically or continuously get the time
  361.                from the  calendar clock.   This can  totally eliminate
  362.                problems with  missing day changes and  realtime clocks
  363.                that  are inaccurate.   CLOCK.SYS provides  support for
  364.                many types  of calendar  clocks including  many of  the
  365.  
  366.                original add-in clocks  of the 8088 era.  If your clock
  367.                is not currently supported, I want to hear from you.  I
  368.                will be happy to add it to the software.
  369.               
  370.                CLK.EXE  is a  program  that allows  you to  separately
  371.                control your  DOS/BIOS internal clock  and battery-pro-
  372.  
  373.                tected  calendar clock.  Most importantly, CLK.EXE will
  374.                handle time zones and will automatically switch between
  375.                standard and  daylight savings time  for you.   It also
  376.                supports automatic adjustment for calendar clock drift,
  377.                checks  for incorrect  or unlikely  times, and  can re-
  378.                strict time changes.
  379.  
  380.  
  381.                CLKDEMO.EXE is a small part of CLK.EXE that is provided
  382.                in source  code (C language)  form so that you  can see
  383.                how    to    add   clock    control    to    your   own
  384.                applications.II.CLOCK.SYS    -    Replacement    Device
  385.                DriverCLOCK.SYS is  a device  driver that replaces  the
  386.  
  387.                built-in  CLOCK$ device  driver in  DOS levels  2.1 and
  388.                above.   CLOCK.SYS adds many functions  not provided in
  389.                the  standard DOS CLOCK$ device driver.   You won't see
  390.                mention  of the DOS  CLOCK$ device  driver in  your DOS
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.           CLOCK Version 3.52                              November 19, 1993
  405.  
  406.  
  407.                user's guides.  You will see a very small mention of it
  408.                in the system's  programmers reference  manuals if  you
  409.                are an  assembly language developer.   It is  there and
  410.  
  411.                DOS  was specifically  designed to  let you  replace it
  412.                with one  of your own even  if the manual  doesn't tell
  413.                you that.
  414.  
  415.           A.Unique Clock Hardware  SupportCLOCK.SYS was originally  written
  416.           especially for those people whose clocks are not supported by new
  417.  
  418.           levels of DOS.  This  usually occurs because your vendor  stopped
  419.           providing  new levels  of DOS  adapted for  your  computer model.
  420.           Before  the days of the PC/AT  and standard clock interfaces, DOS
  421.           was usually sold  directly to hardware vendors who  customized it
  422.           for  their system and delivered it with the system.  In addition,
  423.           many of  the early clocks  were provided  by third-party,  after-
  424.  
  425.           market vendors who had no  idea what system it would be  used in.
  426.           Since those systems and clocks have been  out of production for a
  427.           long time, most  of the vendors have  stopped providing upgrades.
  428.           Yet most  of those  PCs will  happily run  DOS 3.3  or above  and
  429.           especially DOS  5.0 except that you have to give up your calendar
  430.           clock.
  431.  
  432.  
  433.           CLOCK.SYS supports a wide variety of different clock hardware and
  434.           BIOS interfaces.  As far as possible, CLOCK.SYS will automatical-
  435.           ly determine  what  clock interface  to use.    If the  automatic
  436.           determination  does  not  work  for  your system,  you  may  tell
  437.           CLOCK.SYS specifically what interface type  to use.  CLOCK.SYS is
  438.  
  439.           also  required  by anyone  who wants  to use  CLK as  it provides
  440.           functions not provided  by the normal  DOS CLOCK$ device  driver.
  441.           CLOCK.SYS is fully compatible with  the DOS device driver on  all
  442.           modern PCs and many older ones.
  443.  
  444.           If your PC clock is not currently supported but you would like to
  445.  
  446.           remove  the restrictions  on what  versions of  DOS you  can use,
  447.           please contact  me by mail or on CompuServe.   I will be happy to
  448.           add  support for your clock.  I will need some technical informa-
  449.           tion and help from you in getting it to work so I will give you a
  450.           $0 usage license for your help.  Please see section  II.C for the
  451.           current list of supported clocks and Appendix B for a description
  452.  
  453.           of those clocks.
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.           CLOCK Version 3.52                              November 19, 1993
  471.  
  472.  
  473.           B.Installing CLOCK.SYSTo  install the  device driver  include the
  474.           following line in your CONFIG.SYS file.
  475.  
  476.  
  477.           Syntax    device=[d:][path\]clock.sys [type][,io_addr] [/N]
  478.  
  479.                                           or
  480.  
  481.                     device=[d:][path\]clock.sys 3[,segment[,write0,
  482.                          write1,read]] [/N]
  483.  
  484.  
  485.                                           or
  486.  
  487.                     device=[d:][path\]clock.sys A[,base_year] [/N]
  488.  
  489.  
  490.  
  491.           Parameters     d:
  492.                          Identifies the drive containing CLOCK.SYS.  If  d:
  493.                          is not provided, the boot drive is assumed.
  494.  
  495.                     path\
  496.                          Specifies the directory containing CLOCK.SYS.   If
  497.  
  498.                          path\ is not given, the root directory is assumed.
  499.  
  500.                     CLOCK.SYS
  501.                          Is the name of the CLOCK.SYS file.  You may change
  502.                          the name  if you  wish, but you  must not  use the
  503.                          .COM or .EXE extensions.
  504.  
  505.  
  506.                     type
  507.                          Is the kind of calendar clock on  your system.  If
  508.                          you do not provide type, CLOCK.SYS will probe your
  509.                          system   to  determine   which  clock   you  have.
  510.                          CLOCK.SYS is  usually able  to detect the  type of
  511.  
  512.                          calendar  clock without trouble.   It is possible,
  513.                          however, that you have some other hardware in your
  514.                          system that could fool  CLOCK.SYS.  For that  rea-
  515.                          son, you might need to  provide the type of clock.
  516.                          See section II.C and Appendix B for more  informa-
  517.                          tion about the clock types.
  518.  
  519.  
  520.                     io_addr
  521.                          Is  the I/O  bus address  of your  clock hardware.
  522.                          Some of  the types  of clocks  that are  supported
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.           CLOCK Version 3.52                              November 19, 1993
  537.  
  538.  
  539.                          were set  up at a  wide variety of  I/O addresses.
  540.                          CLOCK.SYS  probes  all the  commonly used  I/O ad-
  541.                          dresses for these  clocks.   However, you or  your
  542.  
  543.                          vendor may have installed your clock at an address
  544.                          that CLOCK.SYS  doesn't know about.   By providing
  545.                          the  address, you  make it  much more  likely that
  546.                          CLOCK.SYS will correctly find your clock.  Even if
  547.                          you don't know what  type of clock you  have, pro-
  548.                          viding the I/O address may be enough for CLOCK.SYS
  549.  
  550.                          to determine which one it is.  io_addr is current-
  551.                          ly used with clock types 4, 6,  7, 8, 9, B, and C.
  552.                          Normally this is  240, 2C0, or 340 for types 4, 6,
  553.                          and 7.  It is 210 or 310 for type 9.  It is E0 for
  554.                          type  B.  And, it is 338  for type C.  All numbers
  555.                          are in  hex.  For  example, an AST  Research clock
  556.  
  557.                          might be:
  558.  
  559.                          device=[d:][path\]clock.sys 4,2C0
  560.  
  561.                          If you  do  not specify  the "io_addr",  CLOCK.SYS
  562.                          will try to determine the correct address by prob-
  563.  
  564.                          ing.
  565.  
  566.                          If you are sure that you have an I/O clock but you
  567.                          are not sure which one  it is, specify type 8  and
  568.                          supply the io_addr if  possible.  Type 8  does not
  569.                          represent a specific clock.  Rather it attempts to
  570.  
  571.                          determine whether your clock is a type 4, 6, 7, 9,
  572.                          or B using  a sequence of  tests similar to  those
  573.                          used by  some of the  I/O clock vendors  to figure
  574.                          out what kind of clock you have.
  575.  
  576.                     If you  have a  memory mapped  clock, you  may use  the
  577.  
  578.                     second format to specify the addresses to be used.   If
  579.                     you don't know the addresses, CLOCK.SYS will attempt to
  580.                     determine them by probing.
  581.  
  582.                     segment
  583.                          Is  the base  address used  to  access the  clock.
  584.  
  585.                          Usually  your documentation will  give the segment
  586.                          address as  four hex digits such as  FE00 or F000.
  587.                          Some addresses may be less than four digits (e.g.,
  588.                          70).   Other documentation  may show  addresses in
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.           CLOCK Version 3.52                              November 19, 1993
  603.  
  604.  
  605.                          the  form aaaa:bbbb.    In this  case the  segment
  606.                          address is  the aaaa  value.  Sometimes  these ad-
  607.                          dresses are  written as 0xaaaa,  aaaah, aaaaH,  or
  608.  
  609.                          0Xaaaa.  In all of these forms there is a 2- to 4-
  610.                          digit hex number that is the segment address.
  611.  
  612.                     write0
  613.                          Is the offset used to write 0 bits.  It must  also
  614.                          be a hex  address and may be 0,  F002, or anything
  615.  
  616.                          else the vendor chose.  If the addresses are given
  617.                          in  the aaaa:bbbb form, use  the bbbb.  With these
  618.                          clocks,  you read and  write the  clock by reading
  619.                          the  memory addresses.   For example,  reading ad-
  620.                          dress segment:write0 results in writing a zero bit
  621.                          to the clock.   Writing an appropriate  length se-
  622.  
  623.                          quence of zero and one bits sets the clock.
  624.  
  625.                     write1
  626.                          Is the offset used to write 1 bits.
  627.  
  628.                     read
  629.  
  630.                          Is the offset used to read bits.
  631.  
  632.                          If  your documentation  gives the  segment address
  633.                          but isn't  clear about  the offsets, just  specify
  634.                          the  segment address  and CLOCK.SYS  will try  all
  635.                          offset combinations that it knows about.
  636.  
  637.  
  638.                          If you specify one of the offsets, you must speci-
  639.                          fy them all.
  640.  
  641.                     The third format is used with the AT&T 6300 clocks.
  642.  
  643.  
  644.                     base_year
  645.                          Is used for the AT&T 6300  clocks (type=A).  Dates
  646.                          prior to that year or more than 7 years after that
  647.                          year will  not be handled  correctly.  If  no base
  648.                          year  is specified, 1992 will  be used.  Dates be-
  649.                          tween the  start of the  base year and the  end of
  650.  
  651.                          the seventh year later are handled (e.g., 1992-1-1
  652.                          until 1999-12-31).
  653.  
  654.                     /N
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.           CLOCK Version 3.52                              November 19, 1993
  669.  
  670.  
  671.                          Indicates that  you do  not want CLOCK.SYS  to at-
  672.                          tempt  to  detect missed  date changes.   Normally
  673.                          CLOCK.SYS  will  try  to detect  when  a  date has
  674.  
  675.                          changed that was  not reported by the BIOS.   This
  676.                          usually  happens when  a program  is running  past
  677.                          midnight and calls the BIOS to read the time rath-
  678.                          er than calling DOS.  That program  sees the date-
  679.                          change   indication  from   the   BIOS   and   DOS
  680.                          (CLOCK.SYS) never gets a chance to change the day.
  681.  
  682.                          However,  the logic  that  CLOCK.SYS uses  can  be
  683.                          fooled by programs  that change the time  with di-
  684.                          rect calls  on the BIOS  and may advance  the date
  685.                          incorrectly.   This is very rare, but if your date
  686.                          advances unexpectedly or by more than one day, you
  687.                          may want to use this option.
  688.  
  689.  
  690.           Notes     DOS interfaces                    ______________
  691.                     All DOS DATE  and TIME  commands and all  DOS date  and
  692.                     time system calls will operate  with no apparent change
  693.                     to  you or  any program.   Unless you have  used CLK to
  694.                     change the time handling, your clocks are  handled just
  695.  
  696.                     as DOS would handle them.
  697.  
  698.                     Dates and leap years                    ____________________
  699.                     CLOCK.SYS supports all valid DOS dates from 1980-1-1 to
  700.                     2079-12-31.   It supports dates to  2099-12-31 for many
  701.                     of the clocks.  CLOCK.SYS also handles year changes and
  702.  
  703.                     leap years automatically for clock types  that don't do
  704.                     it themselves.
  705.  
  706.                     Time zones and daylight savings time                    ____________________________________
  707.                     CLOCK.SYS  in conjunction with CLK.EXE provides support
  708.                     for multiple  time zones  and automatic  conversion be-
  709.  
  710.                     tween daylight  savings time  and standard time  at the
  711.                     appropriate  times  of  the  year.   For  this  reason,
  712.                     CLOCK.SYS  may be  of great  use  to you  even if  your
  713.                     version of DOS already supports your clock correctly.
  714.  
  715.                     Clock synchronization                    _____________________
  716.  
  717.                     Normally, CLOCK.SYS  operates  identically to  the  DOS
  718.                     CLOCK$ device driver.   At boot it  sets the DOS  clock
  719.                     from the calendar  clock.  Any time you change the date
  720.                     or time it writes to both clocks.
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.           CLOCK Version 3.52                              November 19, 1993
  735.  
  736.  
  737.                     With CLK.EXE  you have several  other options.   If you
  738.                     have  specified a  time zone  and offset  with CLK.EXE,
  739.                     CLOCK.SYS will adjust  all times read from  and written
  740.  
  741.                     to the calendar clock by the time zone offset.  You can
  742.                     also set  it to read the calendar clock rather than the
  743.                     DOS  clock for  some  or all  time  requests to  ensure
  744.                     continued synchronization of  the two clocks.   You can
  745.                     also totally separate the  two clocks so that  DOS time
  746.                     and  date functions  only read  and write  the DOS/BIOS
  747.  
  748.                     internal clock.
  749.  
  750.                     Time setting limits                    ___________________
  751.                     CLK.EXE  can tell CLOCK.SYS to apply limits to the time
  752.                     changes that  it will  accept  or stop  accepting  time
  753.                     changes at all.  For example, you can tell CLOCK.SYS to
  754.  
  755.                     accept no  changes that would  set the clock  backward.
  756.                     You can also inhibit all changes.
  757.  
  758.                     Password Protection                    ___________________
  759.                     CLK.EXE can  establish  a password  to  control  future
  760.                     changes to the time zone, connection, and  time setting
  761.  
  762.                     limits.   Once  the password  is  set, all  attempts to
  763.                     change those values  will simply be ignored  unless the
  764.                     correct password  is  supplied.   You  may  change  the
  765.                     daylight versus standard time  flag and the  continuous
  766.                     time display without knowing the password.
  767.  
  768.  
  769.                     Continuous Time Display                    _______________________
  770.                     CLK.EXE can tell CLOCK.SYS to display the time continu-
  771.                     ously at any position on your screen.   You specify the
  772.                     cursor coordinates, display  attributes, and 12-hour or
  773.                     24-hour  mode  and  CLOCK.SYS will  update  the display
  774.                     every second.
  775.  
  776.  
  777.                     Saving Settings Across Boots                    ____________________________
  778.                     With  CLK.EXE  you  can  save  the   current  state  of
  779.                     CLOCK.SYS at  any time  in a form  that can be  used on
  780.                     your next boot.  You can set up your time zone, setting
  781.                     limits, connection mode, continuous display, and  pass-
  782.  
  783.                     word  and then save  a new version  of CLOCK.SYS.  This
  784.                     new  version  will  automatically  start  running  with
  785.                     without having to scan for your clock type and with all
  786.                     your standard state automatically in effect.
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.           CLOCK Version 3.52                              November 19, 1993
  801.  
  802.  
  803.           C.Clock TypeThere are almost as many different implementations of
  804.           PC  clocks as there are different types  of PCs.  Until the PC/AT
  805.           came along, there  was no standard for  battery-protected clocks,
  806.  
  807.           and  each  PC and  add-in  vendor was  likely  to  implement them
  808.           differently.  With the PC/AT a standard and documented  interface
  809.           for such clocks  was provided.   Since that  time, most PCs  have
  810.           followed the PC/AT standard.  It is earlier  PCs, especially 8088
  811.           PCs, that don't follow the standard.  Since these are early  PCs,
  812.           there  is also  a high probability  that the vendor  is no longer
  813.  
  814.           providing  modified versions  of  DOS with  built-in support  for
  815.           their clocks.   Most  add-in clock  vendors never  did provide  a
  816.           modified  DOS  and  you had  to  manage your  clock  with utility
  817.           programs.  This leaves you faced  with the choice between staying
  818.           with an early version of DOS or giving up your clock.
  819.  
  820.  
  821.           CLOCK.SYS is  intended to  free you from  those limitations.   It
  822.           will work with  all versions of  DOS from  2.10 through 5.00  and
  823.           undoubtedly beyond.  It  also attempts to automatically determine
  824.           what kind of  clock you have and install  the correct support for
  825.           it.  However, there are often enough differences between PCs that
  826.           the  automatic determination  may not  find anything or  may even
  827.  
  828.           make the  wrong choice.  To  give you more control  of the situa-
  829.           tion, you may specify the clock  interface by giving an interface
  830.           number.
  831.  
  832.           It will  not always  be easy to  decide what interface  number to
  833.           use.   You will at least  need some technical information  on how
  834.  
  835.           your clock works or  on the BIOS calls  used to control the  bat-
  836.           tery-protected clock.  If you find a description below that seems
  837.           to match, give it a  try.  The most that should go  wrong is that
  838.           your time  and date will be set incorrectly, but then they proba-
  839.           bly weren't working anyhow.
  840.  
  841.  
  842.           If you aren't sure what interface to use or if you are sure  that
  843.           your clock is not supported, LET ME KNOW.  I WOULD LIKE  TO HELP.
  844.           You can help me make CLOCK.SYS better for everyone.  I would even
  845.           like to  hear from  you if  CLOCK.SYS did work  for you  and your
  846.           clock isn't currently  listed.  I  would like to  be able to  add
  847.           your PC  manufacturer and model  number to the supported  list so
  848.  
  849.           others know what to use.  If CLOCK.SYS did not work for you, I am
  850.           interested  in making the changes  so that it does  work.  If you
  851.           can  provide me with the necessary  technical information, I will
  852.           make the changes.
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.           CLOCK Version 3.52                              November 19, 1993
  867.  
  868.  
  869.           Usually,  a technical  reference  manual with  hardware and  BIOS
  870.           interfaces is the best source.  Even if you don't  have one, your
  871.           original  hardware  vendor  may be  willing  to  send  you enough
  872.  
  873.           information to  allow you  to program  the clock.    If all  else
  874.           fails, we may even  be able to use an old copy  of DOS or a clock
  875.           setting utility to  figure out how it works.   Before we do that,
  876.           check your license to be sure that it is not forbidden  to disas-
  877.           semble the software to see how the clock works.  
  878.           The following table  shows the systems that  have been determined
  879.  
  880.           to work  with existing clock  types.   If your system  is in  the
  881.           list, try the clock type indicated.   If not, look through Appen-
  882.           dix B which tells you  about the characteristics of each type  of
  883.           clock and see if anything seems to match your system type.
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.           CLOCK Version 3.52                              November 19, 1993
  933.  
  934.  
  935.                    ╔═══════════════════════════╤══════════════════════════╗
  936.                    ║     SYSTEM                │  CLOCK TYPE              ║
  937.                    ╟───────────────────────────┼──────────────────────────╢
  938.  
  939.                    ║     Amstrad PC1521DD      │  0                       ║
  940.                    ╟───────────────────────────┼──────────────────────────╢
  941.                    ║     AST Research          │  8 (4, 6, or 7) See dis- ║
  942.                    ║       Six-Pack            │  cussion above and in    ║
  943.                    ║       I/O Plus            │  Appendix B              ║
  944.                    ║       etc.                │                          ║
  945.  
  946.                    ╟───────────────────────────┼──────────────────────────╢
  947.                    ║     AT&T 6300             │  A                       ║
  948.                    ╟───────────────────────────┼──────────────────────────╢
  949.                    ║     Hyundai 8088          │  B                       ║
  950.                    ╟───────────────────────────┼──────────────────────────╢
  951.                    ║     IBM PC/AT and most    │  0                       ║
  952.  
  953.                    ║     PCs since then.       │                          ║
  954.                    ╟───────────────────────────┼──────────────────────────╢
  955.                    ║     Leading Edge Model D  │  5                       ║
  956.                    ╟───────────────────────────┼──────────────────────────╢
  957.                    ║     Mitsubishi 8088       │  5                       ║
  958.                    ╟───────────────────────────┼──────────────────────────╢
  959.  
  960.                    ║     Multi I/O Card        │  C                       ║
  961.                    ╟───────────────────────────┼──────────────────────────╢
  962.                    ║     Quadram Corp.         │  9                       ║
  963.                    ║       QuadCard            │                          ║
  964.                    ║       QuadCard II         │                          ║
  965.                    ║       QuadCard 512+       │                          ║
  966.  
  967.                    ╟───────────────────────────┼──────────────────────────╢
  968.                    ║     SMT No-Slot Clock     │  3                       ║
  969.                    ╟───────────────────────────┼──────────────────────────╢
  970.                    ║     Sperry PC-1           │  5                       ║
  971.                    ╟───────────────────────────┼──────────────────────────╢
  972.                    ║     Sperry PC/HT          │  5                       ║
  973.  
  974.                    ╟───────────────────────────┼──────────────────────────╢
  975.                    ║     Tandy 1200HD          │  4                       ║
  976.                    ╟───────────────────────────┼──────────────────────────╢
  977.                    ║     Vendex Turbo-888-XT   │  4                       ║
  978.                    ╟───────────────────────────┼──────────────────────────╢
  979.                    ║     Zenith Supersport 20  │  1                       ║
  980.  
  981.                    ╟───────────────────────────┼──────────────────────────╢
  982.                    ║     Zenith Z-18x          │  1                       ║
  983.                    ╚═══════════════════════════╧══════════════════════════╝
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.           CLOCK Version 3.52                              November 19, 1993
  999.  
  1000.  
  1001.           D.ExamplesFor almost everyone,  the only format you  ever need to
  1002.           use is:
  1003.                device=[d:][path\]clock.sys
  1004.  
  1005.  
  1006.           If CLOCK.SYS is  in the root directory of your  boot device, this
  1007.           is:
  1008.                device=clock.sys
  1009.  
  1010.           CLOCK.SYS will  quite happily load  into the upper  memory blocks
  1011.  
  1012.           (UMBs) provided  by DOS 5.0 and by other software.  With DOS 5.0,
  1013.           you might use:
  1014.                devicehigh=clock.sys
  1015.  
  1016.           With some memory managers you can even load CLOCK.SYS  into upper
  1017.           memory blocks on  earlier levels of DOS.  See your manual for the
  1018.  
  1019.           commands to use.  Some of  these memory managers will create UMBs
  1020.           on 8088 and  80286 systems.   CLOCK.SYS  loads and  runs high  on
  1021.           those systems as well.
  1022.  
  1023.           With a memory mapped clock that uses  an address combination that
  1024.           CLOCK.SYS  doesn't search automatically and with CLOCK.SYS stored
  1025.  
  1026.           in the C:\UTILITY directory, you might use:
  1027.                device=c:\utility\clock.sys 3,ffff,f000,f004,f008
  1028.           Please note that the memory addresses chosen for this example are
  1029.           not likely to match those of your clock and you should substitute
  1030.           the addresses appropriate to your clock.
  1031.  
  1032.  
  1033.           If you have an I/O  clock with the same interface as  the Quadram
  1034.           Corp. clock but a different I/O address, you might use:
  1035.                device=clock.sys 9,3fc
  1036.           if your I/O base address were 3fc.
  1037.  
  1038.           If you have one of the AT&T 6300 system types and you occasional-
  1039.  
  1040.           ly need to set your clock prior to 1992-1-1, you might use:
  1041.                device=clock.sys a,1988
  1042.           E.Future  EnhancementsOf course,  I hope  to add  more clocks  as
  1043.           people ask for them.   Those old PCs are still good for  a lot of
  1044.           what we  do even if they  are sometimes relegated to  a secondary
  1045.           status.
  1046.  
  1047.  
  1048.           There are no other outstanding enhancements currently planned for
  1049.           CLOCK.SYS.III.CLK.EXE  -  Clock   Control  ProgramCLK  gives  you
  1050.           complete  control over the  operation of  the calendar  clock and
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.           CLOCK Version 3.52                              November 19, 1993
  1065.  
  1066.  
  1067.           DOS/BIOS clock.   You  can operate  them separately  or together.
  1068.           You  can  establish  time  zones, daylight  savings  time  rules,
  1069.           automatic adjustment, synchronization rules, and more.
  1070.  
  1071.  
  1072.           A.CLK CommandSyntax clk [function] [function ...] [/I[file]] [/?]
  1073.  
  1074.                               or in full form
  1075.  
  1076.                     clk [A=±sss.cc] [C=A|D|R|W] [D=[N][x,y,a[,12|,24]]
  1077.  
  1078.                          [L=...] [M=...] [R=A|B-hh:mm:ss|F+hh:mm:ss|N|R]
  1079.                          [S=C|D]    [TZ=...]    [W=-back,+forward]     [/B]
  1080.                          [/I[file][,C]]  [/M[file][,C]] [/P[N]]  [/S[file]]
  1081.                          [/?]
  1082.  
  1083.           Parameters     function
  1084.  
  1085.                          There  are many  functions that  may be  used with
  1086.                          CLK.EXE and  they are discussed  in the  following
  1087.                          paragraphs.   You may use any  number of functions
  1088.                          on a  single command  line and  they will  be pro-
  1089.                          cessed in  the  order  in which  you  enter  them.
  1090.                          However, if  any error is discovered in any of the
  1091.  
  1092.                          functions, none of them are processed.  Thus, 
  1093.                               clk c=r tz=:est
  1094.                          is the same as the two command lines:
  1095.                               clk c=r
  1096.                               clk tz=:est
  1097.                          except that an error in either of the functions in
  1098.  
  1099.                          the  first example cause  the whole  command to be
  1100.                          ignored.
  1101.  
  1102.                          The case (upper  or lower) of any of  the function
  1103.                          names, options,  or values  is ignored except  for
  1104.                          the TZ  function's time  zone names.   Even there,
  1105.  
  1106.                          the case is not used.  It is simply  preserved for
  1107.                          later display.
  1108.  
  1109.                          You can display a help message about  any function
  1110.                          or  option by  immediately following  the function
  1111.                          letter or  option letter with ?.  Thus M? displays
  1112.  
  1113.                          help about the M=  function and /I? displays  help
  1114.                          about the I  option.  /?  displays a help  message
  1115.                          about the CLK command line.
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.           CLOCK Version 3.52                              November 19, 1993
  1131.  
  1132.  
  1133.                     none
  1134.                          If no function or option is provided, CLK displays
  1135.                          the current  state of operation  of CLOCK.SYS  and
  1136.  
  1137.                          the current time from both the  calendar clock and
  1138.                          the DOS/BIOS clock.
  1139.  
  1140.                          If you have used CLK to set a time  zone (TZ func-
  1141.                          tion), the current time zone name and offset value
  1142.                          are  displayed.     These  values  are  saved   in
  1143.  
  1144.                          CLOCK.SYS so that they may  be used for time func-
  1145.                          tions.
  1146.  
  1147.                          The connection state of the clocks (C function) is
  1148.                          displayed  as is the current restrictions (R func-
  1149.                          tion) on clock changes.
  1150.  
  1151.  
  1152.                          All  uses  of CLK  (except errors  and /?)  end by
  1153.                          displaying the  same information.  You always know
  1154.                          the state of your two clocks after execution.
  1155.  
  1156.                     A=±sss.cc
  1157.  
  1158.                          The Adjust function is used to set a daily adjust-
  1159.                          ment factor in seconds and 100ths of seconds.
  1160.  
  1161.                          This function assumes that you have some knowledge
  1162.                          of the  rate at  which your calendar  clock drifts
  1163.                          with respect to "real" time.   Presumably you have
  1164.  
  1165.                          periodically set your  clock using a  program that
  1166.                          calls the Naval Observatory or NIST and  noted the
  1167.                          difference  over  time.   Some such  programs will
  1168.                          help you to calculate the drift rate.  You can get
  1169.                          a very good adjustment from a decent quartz watch.
  1170.  
  1171.  
  1172.                          The value may be a positive or  negative number in
  1173.                          the range -326.99  to +326.99 seconds per  day but
  1174.                          reasonable values are likely to be a fraction of a
  1175.                          second.
  1176.  
  1177.                          The first time  you use A=, your clock  is not ad-
  1178.  
  1179.                          justed.  The value of  A and the current time  are
  1180.                          saved in  a file  for later  use.   Later you  can
  1181.                          choose to run CLK with the /I option to invoke the
  1182.                          file.  The elapsed time  since the last adjustment
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.           CLOCK Version 3.52                              November 19, 1993
  1197.  
  1198.  
  1199.                          (or the time you last changed A) in days and frac-
  1200.                          tions is multiplied by  A to calculate any adjust-
  1201.                          ment that needs to be applied.  Only whole seconds
  1202.  
  1203.                          of adjustment are applied.
  1204.  
  1205.                          The  A= function only  sets the adjustment factor.
  1206.                          The actual  adjustment is  carried out  by the  L=
  1207.                          function.  You  don't have to  enter the L=  func-
  1208.                          tion.  CLK will do that for you the first time you
  1209.  
  1210.                          use A= and  will keep  it up to  date as it  later
  1211.                          makes adjustments.
  1212.  
  1213.                          NOTE:  Do  not use the  A= function with the  AT&T
  1214.                          6300 clocks  (Type A) or the  Quadram clocks (Type
  1215.                          9).  They  only permit the time  to be set  to the
  1216.  
  1217.                          nearest minute.
  1218.  
  1219.                     C=A
  1220.                          Connects the two  clocks for All operations.   All
  1221.                          read operations go directly to the calendar clock.
  1222.                          The calendard clock is read, the time  is adjusted
  1223.  
  1224.                          for any time zone offset, and the adjusted time is
  1225.                          written to the DOS clock and returned to the call-
  1226.                          er.  With this  function, your calendar clock  es-
  1227.                          sentially becomes  the only  clock.  However,  the
  1228.                          DOS clock is set each time so that any application
  1229.                          reading the clock directly (without going  through
  1230.  
  1231.                          DOS) sees the same  time that DOS reports.   It is
  1232.                          unwise to use  this function if your clock is slow
  1233.                          (some I/O clocks and some memory-mapped clocks) or
  1234.                          if  it only increments  in units of  seconds (most
  1235.                          clocks).  Any time zone offset is applied to reads
  1236.                          and writes.
  1237.  
  1238.  
  1239.                     C=D
  1240.                          Disconnects  the two  clocks.   Any change  of the
  1241.                          date  and time  will  affect the  DOS  clock only.
  1242.                          Reads also use  the DOS clock only.  This function
  1243.                          allows  you to perform  any operation on  the time
  1244.  
  1245.                          without  affecting your  calendar  clock.   It  is
  1246.                          useful for dealing with  ill-behaved programs that
  1247.                          need to  change the time and  for testing programs
  1248.                          at different dates and times.   You can later  use
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.           CLOCK Version 3.52                              November 19, 1993
  1263.  
  1264.  
  1265.                          the C=R,  C=A, or other functions  to re-establish
  1266.                          the  value in  your  DOS clock  from the  calendar
  1267.                          clock.
  1268.  
  1269.  
  1270.                     C=R
  1271.                          Connects  the two clocks  for writing and periodic
  1272.                          Reading.   This  function may  be  used when  your
  1273.                          clocks drift  slowly with  respect to  each other.
  1274.                          If the  time has not  been read for about  10 sec-
  1275.  
  1276.                          onds, the calendar clock will be read, adjusted by
  1277.                          the offset if  any, and the adjusted  time written
  1278.                          to the DOS clock and returned to the caller.  This
  1279.                          periodic  Read assures you  that the  clocks never
  1280.                          get  very  far out  of  synchronization with  each
  1281.                          other.   Some  calendar clocks  take a  relatively
  1282.  
  1283.                          long  time to read  and most don't  have 100ths of
  1284.                          seconds.  By only  reading the calendar clock when
  1285.                          no other time request has  occurred in the last 10
  1286.                          seconds,  we minimize  both the  overhead and  any
  1287.                          visibility of time jumps.
  1288.  
  1289.  
  1290.                     C=W
  1291.                          Connects the two clocks for Writing.  This is  the
  1292.                          default  mode of  operation and  is the  same mode
  1293.                          that the DOS CLOCK$  device driver supports as its
  1294.                          only mode.  Reading the  time is served by the DOS
  1295.                          clock.   Writing the time sets  both clocks.  If a
  1296.  
  1297.                          time  zone offset  has previously  been specified,
  1298.                          all  writes to the clock  are adjusted so that the
  1299.                          calendar clock  remains on  the  base time.    For
  1300.                          example, if the  calendar clock is set to  UTC and
  1301.                          you specify that  you want to use CST which has an
  1302.                          offset of 6 hours from UTC, all writes of the time
  1303.  
  1304.                          will have 6 hours added to them  before writing to
  1305.                          the calendar clock.   Thus the  DOS clock and  the
  1306.                          calendar clock remain at a constant time offset.
  1307.  
  1308.                     D=N
  1309.                          The D=  function controls  a continuous time  dis-
  1310.  
  1311.                          play.  D=N turns off the continuous display.
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.           CLOCK Version 3.52                              November 19, 1993
  1329.  
  1330.  
  1331.                     D=x,y,a[,12|,24]
  1332.                          Starts a continuous  time display at cursor  posi-
  1333.                          tion x,y with  display attribute a.   Cursor posi-
  1334.  
  1335.                          tion 0,0 is  the upper left corner of  the screen.
  1336.                          The typical screen format runs from 0,0  to 79,24.
  1337.                          The  display attribute is  a two-digit  hex number
  1338.                          that gives  the background and  foreground colors.
  1339.                          The high-order digit is the background color (0 to
  1340.                          7 usually)  and the  low-order digit is  the fore-
  1341.  
  1342.                          ground or character  color (0 to F).   The default
  1343.                          display is a  24-hour clock in the  form HH:MM:SS.
  1344.                          If  you add the ",12", the  display will use a 12-
  1345.                          hour clock.  No AM or PM indication is given.
  1346.  
  1347.                          D=72,24,79,12 will place the  display at the right
  1348.  
  1349.                          edge of the  last line of most screens.   The text
  1350.                          will be in bright  blue on a white  background and
  1351.                          the hours will run from 12 through 11.
  1352.  
  1353.                          D= by itself will  resume a previous display  that
  1354.                          was turned off  by D=N.   You do  not have to  re-
  1355.  
  1356.                          enter all the values.
  1357.  
  1358.                          The  D= functions  should  not be  used if  CLK is
  1359.                          executed  from within Windows.   If you  try to do
  1360.                          so,  you will  received  an error  message.   This
  1361.                          avoids  a  hung system  which  would occur  if CLK
  1362.  
  1363.                          didn't check.
  1364.  
  1365.                     L=YYYY-MM-DD,hh:mm:ss,±sss.cc
  1366.  
  1367.                          The L= function  is not intended to be used on the
  1368.                          command line, but will  be accepted if you provide
  1369.  
  1370.                          it.   The L=  function is normally  created by CLK
  1371.                          and saved in  the CLK.INI  file for  later use  in
  1372.                          processing adjustments.  The date and  time of the
  1373.                          last adjustment (or the most recent time  you gave
  1374.                          an  A= function on the  command line) are given by
  1375.                          the YYYY-MM-DD,hh:mm:ss.   Any non-digit  except a
  1376.  
  1377.                          space may separate the  sub-fields.  The date  and
  1378.                          time must  be followed by a comma  and any adjust-
  1379.                          ment  remainder.   The adjustment remainder  is in
  1380.                          the same form as the value for the A= function but
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.           CLOCK Version 3.52                              November 19, 1993
  1395.  
  1396.  
  1397.                          will usually be a fraction of a second.  It is the
  1398.                          adjustment  that was  left over  the last  time an
  1399.                          adjustment was  actually  made  since  only  whole
  1400.  
  1401.                          seconds of changes are made to the clock.
  1402.  
  1403.                          The L= function triggers an adjustment  if needed.
  1404.                          Generally, it  will follow  the  A= function  that
  1405.                          sets the adjustment factor.   Both of these  func-
  1406.                          tions normally appear in the CLK.INI file.
  1407.  
  1408.  
  1409.                          The L= function  may also be used by  itself to do
  1410.                          simple arithmetic  on the clocks.   Use it  on the
  1411.                          command line with any earlier date and time and an
  1412.                          adjustment of the  number of seconds  (positive or
  1413.                          negative)  that you want added to  the clock.  The
  1414.  
  1415.                          change will be made  and the last adjustment  time
  1416.                          set to the current time.  For example, 
  1417.                               clk l=1990-1-1,0:0:0,-4
  1418.                          will subtract 4 seconds from the clocks.
  1419.  
  1420.                     M=±sss.cc,YYYY-MM-DD,hh:mm:ss
  1421.  
  1422.                          The  M= function is used to help you calculate the
  1423.                          automatic adjustment  A= value  for your  calendar
  1424.                          clock.  The M= function is used to enter the manu-
  1425.                          al adjustments that you make to the clock in addi-
  1426.                          tion to the automatic adjustments.  The ±sss.cc is
  1427.                          the amount  of  manual adjustment  that  you  have
  1428.  
  1429.                          made.  This may be adjustments made by setting the
  1430.                          clock  with the DOS DATE  and TIME commands or ad-
  1431.                          justments  made by  a time  setting program.   The
  1432.                          YYYY-MM-DD,hh:mm:ss is the date and time at  which
  1433.                          the  adjustment was  made.   It is  very important
  1434.                          that the  date and time  be given with  respect to
  1435.  
  1436.                          the calendar clock and not the DOS  clock, if dif-
  1437.                          ferent.  If you do  not supply the date and  time,
  1438.                          the  current date  and time  will be  used.   This
  1439.                          should be sufficiently  accurate if you just  com-
  1440.                          pleted making the adjustement.
  1441.  
  1442.  
  1443.                          The first M= value that you enter  is used only to
  1444.                          set a base date and time.  Then as you enter addi-
  1445.                          tional values in the  future, CLK will calculate a
  1446.                          new value for the A= function by  adding the aver-
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.           CLOCK Version 3.52                              November 19, 1993
  1461.  
  1462.  
  1463.                          age manual  adjustment per  day to the  current A=
  1464.                          value.  Up  to 8 values are  saved in the  CLK.INI
  1465.                          file (or other file  that you specify).  The  more
  1466.  
  1467.                          values you provide and the longer the time period,
  1468.                          the more  accurate the  adjustment will  be.   For
  1469.                          example, if you can only determine  the adjustment
  1470.                          to  the nearest second  (likely), you may  want to
  1471.                          have a  week or  more between  manual adjustments.
  1472.                          The only  restriction is  that the first  and last
  1473.  
  1474.                          manual adjustement must be within one year of each
  1475.                          other.  If  you enter more than 8,  the oldest two
  1476.                          adjustement  values are  collapsed  into a  single
  1477.                          value.
  1478.  
  1479.                          Supplying  a new A= value, presumably based on the
  1480.  
  1481.                          calculations from CLK,  deletes all the M=  values
  1482.                          from the file.  You may either specify a /I option
  1483.                          to specify the file and  read all the functions in
  1484.                          the file, a /M option to specify the file and only
  1485.                          read  the M= functions,  or CLK will automatically
  1486.                          specify the  /M option for  you (but it  will only
  1487.  
  1488.                          know to look for CLK.INI in the directory contain-
  1489.                          ing CLK.EXE).  You may also edit the M=  functions
  1490.                          in the  file and use the /M  option to force a re-
  1491.                          calculation.
  1492.  
  1493.                          When CLK  calculates  a new  adjustment value,  it
  1494.  
  1495.                          tries to determine if any of the M= values are out
  1496.                          of  line with  the rest  of the  values.   It will
  1497.                          ignore, but provide  an error message,  if any  of
  1498.                          the values are  too far away from all  of the oth-
  1499.                          ers.  CLK calculates an average and standard devi-
  1500.                          ation and  ignores all  values (of  adjustment per
  1501.  
  1502.                          day) that are more than 2 standard deviations from
  1503.                          the average.
  1504.  
  1505.                     R=A
  1506.                          The R= function sets restrictions on time changes.
  1507.                          R=A inhibits  All time changes.  When this mode is
  1508.  
  1509.                          set, all attempts to  change the time are  ignored
  1510.                          by CLOCK.SYS.  This includes time  changes attemp-
  1511.                          ted by CLK including time adjustments.  See R=N.
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.           CLOCK Version 3.52                              November 19, 1993
  1527.  
  1528.  
  1529.                     R=B-hh:mm:ss
  1530.                          This function limits the amount of Backward change
  1531.                          of the time.   Any change of more than  the speci-
  1532.  
  1533.                          fied time is ignored.  The "-" is optional  as are
  1534.                          the offset fields.
  1535.                               clk r=b
  1536.                          inhibits all backward changes.
  1537.                               CLK R=B::2
  1538.                          only  allows  backward changes  of two  seconds or
  1539.  
  1540.                          less This might permit CLK to perform  adjustments
  1541.                          but effectively stop other backward changes.
  1542.  
  1543.                     R=F+hh:mm:ss
  1544.                          This  function limits the amount of Forward change
  1545.                          of the time.  Any  change of more than the  speci-
  1546.  
  1547.                          fied time is ignored.   The "+" is optional as are
  1548.                          the offset fields.
  1549.                               CLK R=F+1:00:02
  1550.                          limits forward changes  to 1  hour and 2  seconds.
  1551.                          The R=B and R=F limits  do not apply to the  auto-
  1552.                          matic  conversions between  standard and  daylight
  1553.  
  1554.                          savings time  as these  don't actually  change the
  1555.                          time.  The R=B and R=F functions are also indepen-
  1556.                          dent of the R=A function.
  1557.  
  1558.                     R=N
  1559.                          This function reverses the R=A function and inhib-
  1560.  
  1561.                          its No clock  changes.  The R=A  is independent of
  1562.                          the R=B and R=F.  You can set backward and forward
  1563.                          limits with  R=B and R=F.   Later you  can inhibit
  1564.                          all changes with R=A.  When you do R=N, the previ-
  1565.                          ously set R=B and R=F limits again have an effect.
  1566.  
  1567.  
  1568.                     R=R
  1569.                          This function Resets the limits established by R=B
  1570.                          and R=F.  No limits  are in effect after executing
  1571.                          this function.  It has no effect on the R=A mode.
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.           CLOCK Version 3.52                              November 19, 1993
  1593.  
  1594.  
  1595.                     S=C
  1596.                          Sets  both clocks  to  the current  time from  the
  1597.                          calendar clock.   You  can use  this  even if  the
  1598.  
  1599.                          clocks  are  disconnected  to make  the  DOS clock
  1600.                          equal to the calendar clock.  The time zone offset
  1601.                          is set to  00:00:00 and the time zone  name is set
  1602.                          to UTC to indicate that both clocks are set to the
  1603.                          base time.
  1604.  
  1605.  
  1606.                     S=D
  1607.                          Sets both clocks  to the current time from the DOS
  1608.                          clock.  The value from the DOS clock is written to
  1609.                          the calendar clock.   The time zone offset  is set
  1610.                          to 00:00:00 and  the zone name  is not changed  to
  1611.                          indicate  that both clocks  are set to  your local
  1612.  
  1613.                          time.
  1614.  
  1615.                     TZ=...
  1616.                          Sets the DOS clock to the correct local time based
  1617.                          on the value of the expression  following the TZ=.
  1618.                          This expression  conforms  exactly  to  the  POSIX
  1619.  
  1620.                          1003.1 standard  for time zone handling.   CLK as-
  1621.                          sumes that the  calendar clock currently  contains
  1622.                          UTC  (also known  as GMT,  Greenwich, ZULU,  and Z
  1623.                          time).    UTC  ("Universal Time,  Coordinated"  is
  1624.                          usually spoken as "coordinated universal time") is
  1625.                          the  name of the  international standard time that
  1626.  
  1627.                          is provided by  WWV, WWVH, the  Naval Observatory,
  1628.                          and NIST as well as many other services around the
  1629.                          world.    Most  Unix(r)  systems also  support  TZ
  1630.                          although  many only  partially  support the  POSIX
  1631.                          standard.    See the  notes later  for  a complete
  1632.                          description of the TZ= function.
  1633.  
  1634.  
  1635.                          You  can  put  the  CLK  TZ=...  command  in  your
  1636.                          AUTOEXEC.BAT file.  You should put it prior to any
  1637.                          other statements that  may create or update  files
  1638.                          or  you run the risk  of having confusing times in
  1639.                          your  file directory  (MAKE  could get  especially
  1640.  
  1641.                          confused.).  If you  provide a TZ= function,  your
  1642.  
  1643.                                         ____________________
  1644.  
  1645.           Unix is a registered trademark of Unix Systems Laboratories.
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.           CLOCK Version 3.52                              November 19, 1993
  1659.  
  1660.  
  1661.                          system  will automatically  adjust to  the correct
  1662.                          time  zone every time you boot.   Note that no at-
  1663.                          tempt is made to change between daylight and stan-
  1664.  
  1665.                          dard  time except  when  you  execute  CLK  TZ=...
  1666.                          Adjusting on the fly is very dangerous.  Many pro-
  1667.                          grams  can produce incorrect  results or even cor-
  1668.                          rupt  your data if  time takes a  big step forward
  1669.                          and are even  more likely  to do so  if time  runs
  1670.                          backward.   See section III.C for  a discussion of
  1671.  
  1672.                          the TZ= format.
  1673.  
  1674.  
  1675.                     W=-back,+forward
  1676.                          The W= function is used to establish Warning  lim-
  1677.                          its  on the time.   Each  time the W=  function is
  1678.  
  1679.                          processed (usually  from  the CLK.INI  file),  the
  1680.                          current time  and the previous  time are compared.
  1681.                          If the  current time is outside the -back,+forward
  1682.                          range around the previous  time, a warning message
  1683.                          is displayed requiring  you to press  a key.   The
  1684.                          program will  also exit with  an ERRORLEVEL  of 1.
  1685.  
  1686.                          The full form of the W= function is:
  1687.                          W=N-days/hh:mm:ss,+days/hh:mm:ss,
  1688.                               YYYY-MM-DD,hh:mm:ss
  1689.  
  1690.                          The days sub-field is a  value from 0 to 250 days.
  1691.                          The days  sub-field  combined with  the time  sub-
  1692.  
  1693.                          fields  gives the maximum interval around the pre-
  1694.                          vious  time within  which  the  current time  must
  1695.                          fall.   The previous date and time follow the sec-
  1696.                          ond comma.  For example,
  1697.                               clk w=-0/00:00:02,+91
  1698.                          will  establish a  range of  minus two  seconds to
  1699.  
  1700.                          plus 91  days.  The first time  you use this func-
  1701.                          tion nothing will happen except  that CLK will add
  1702.                          the current date and time to the command and store
  1703.                          it in the  CLK.INI file.  The next time you use if
  1704.                          from  the CLK.INI  file  with CLK /I,  the current
  1705.                          date and  time will  be compared  to the  previous
  1706.  
  1707.                          date and time and the range.   If the current time
  1708.                          is outside  the range, a message  is displayed and
  1709.                          CLK pauses.
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.           CLOCK Version 3.52                              November 19, 1993
  1725.  
  1726.  
  1727.                          The sign characters and  all of the sub-fields are
  1728.                          optional.  Missing sub-fields are treated as zero.
  1729.                          The particular separators are not important except
  1730.  
  1731.                          for  the commas.   Any non-digit  character can be
  1732.                          used for the other separators.  The time and  date
  1733.                          fields are appended  to the function  by CLK  when
  1734.                          the CLK.INI file  is written and are  the previous
  1735.                          time to which the next comparison will be made.  A
  1736.                          typical  function  might be  W=,31.   This command
  1737.  
  1738.                          will  display a  warning  whenever time  has moved
  1739.                          backwards at  all or  has moved  forwards by  more
  1740.                          than 31 days  since the last time you used CLK /I.
  1741.                          If you use CLK /I (see below) in your AUTOEXEC.BAT
  1742.                          file,  this is  very likely  to detect  a miss-set
  1743.                          clock or bad clock battery.  Yet it won't generate
  1744.  
  1745.                          a message  on  every boot.  You will  only get  an
  1746.                          "unnecessary" message  if it has been  more than a
  1747.                          month since you last used the PC.
  1748.  
  1749.                          If the "N" character (or "n")  appears immediately
  1750.                          after the "=", CLK does not pause and wait for you
  1751.  
  1752.                          to press a key after printing the warning message.
  1753.                          The "N" allows you to  use CLK in a .BAT file  and
  1754.                          check for  the warning with the IF ERRORLEVEL com-
  1755.                          mand.
  1756.  
  1757.                     /B
  1758.  
  1759.                          The B option  tells CLK to remain  in command mode
  1760.                          even if no other functions or options are present.
  1761.                          The  /B in  itself performs  no operation,  but it
  1762.                          avoids  CLK going into full-screen mode if all you
  1763.                          want to do is display the current status (e.g., in
  1764.                          a .BAT file).
  1765.  
  1766.  
  1767.                     /I[,C]
  1768.                     or
  1769.                     /Ifile[,C]
  1770.                          The I option  tells CLK to  read the CLK.INI  file
  1771.                          (or  "file" if that is given) for additional func-
  1772.  
  1773.                          tions.  These functions are usually A=, L=, and W=
  1774.                          functions that were previously written to the file
  1775.                          by  CLK.  You may add  any other functions (but no
  1776.                          options) to the file and they will be processed as
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.           CLOCK Version 3.52                              November 19, 1993
  1791.  
  1792.  
  1793.                          if you had entered them at the end of the  command
  1794.                          line.  If  you don't specify  "file" or you  don't
  1795.                          give a path  as part of  "file", CLK will use  the
  1796.  
  1797.                          directory which  contains CLK.EXE.   Thus the  de-
  1798.                          fault  is to  use  CLK.INI in  the  directory that
  1799.                          contains CLK.EXE.  
  1800.  
  1801.                          If you enter an A=, L=, M=, or W= function or  CLK
  1802.                          finds them in  the file, the file  will be updated
  1803.  
  1804.                          with  the new  values  for the  current time  when
  1805.                          appropriate.   If an  adjustment is  made, the  L=
  1806.                          function  will reflect  the date  and time  of the
  1807.                          latest adjustment.   CLK will  update or  create a
  1808.                          CLK.INI file  even if you don't use  the /I option
  1809.                          if you use  the A=, L=, M=, or W= functions on the
  1810.  
  1811.                          command line.
  1812.  
  1813.                          It is very useful to  store your standard TZ=, C=,
  1814.                          and R= functions  in the CLK.INI file.   Then your
  1815.                          AUTOEXEC.BAT file  can  simply contain  a  CLK  /I
  1816.                          command to  set your  clocks  into their  standard
  1817.  
  1818.                          modes, adjust the  time, and check  for bad  clock
  1819.                          values.  You  can also  reestablish your  standard
  1820.                          modes after changes with the same command  entered
  1821.                          from the DOS prompt or a .BAT file.
  1822.  
  1823.                          The file may be hidden  and still be updated with-
  1824.  
  1825.                          out error.  However,  to update a read-only  file,
  1826.                          you must  add ,C to  the end of the  option.  This
  1827.                          indicates that CLK  may Change  the attributes  of
  1828.                          the file in order to update it.  CLK will  restore
  1829.                          the original  attributes.  System files may not be
  1830.                          updated.
  1831.  
  1832.  
  1833.                     /M[,C]
  1834.                     or
  1835.                     /Mfile[,C]
  1836.                          The  M option is identical  to the I option except
  1837.                          that only  the M= function lines are read from the
  1838.  
  1839.                          file.   Its primary  use is internal  to CLK  when
  1840.                          processing  an M= function  from the command line.
  1841.                          You may also use /Mfile to specify the location of
  1842.                          the  file when entering  M= values.   You may also
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.           CLOCK Version 3.52                              November 19, 1993
  1857.  
  1858.  
  1859.                          use  the M  option to  cause recalculation  of the
  1860.                          adjustment factor at any time (e.g., after editing
  1861.                          the file).
  1862.  
  1863.  
  1864.                     /P
  1865.                     or
  1866.                     /PN
  1867.                          Controls the  use of  password protection  of mode
  1868.                          changes.   When you use /P, CLK will ask you for a
  1869.  
  1870.                          new password.  It will then ask  you to repeat the
  1871.                          password to ensure that you entered what you want.
  1872.                          It does  not display the password as you enter it.
  1873.                          The password is then passed to CLOCK.SYS and pass-
  1874.                          word protection is  enabled.  On  future calls  to
  1875.                          CLOCK.SYS, you will  be asked for the  password if
  1876.  
  1877.                          protection is enabled.  You may use /PN to disable
  1878.                          password protection, but you will have to  provide
  1879.                          the current password to  do so.  If used  with the
  1880.                          /S feature, the password protection will remain in
  1881.                          effect even across reboots.  /P should be the last
  1882.                          field on a CLK command line.
  1883.  
  1884.  
  1885.                     /S
  1886.                     or
  1887.                     /Sfile
  1888.                          Saves the current copy  of CLOCK.SYS as it resides
  1889.                          in memory.   If you  do not specify  the file, the
  1890.  
  1891.                          memory version is written to file CLOCK.NEW in the
  1892.                          same directory  that contains CLK.EXE.   While you
  1893.                          may  directly overwrite  the  file CLOCK.SYS,  you
  1894.                          should be very  careful doing so as  whatever your
  1895.                          current  state  is will  take effect  on  the next
  1896.                          boot.
  1897.  
  1898.  
  1899.                          PLEASE   MAKE  A  BACKUP  COPY  of  your  original
  1900.                          CLOCK.SYS before  replacing it with a  saved file.
  1901.                          The saved  file does  not do  any probing  at boot
  1902.                          time as  it already knows exactly  what your clock
  1903.                          is.   It does not  need any parameters on  the de-
  1904.  
  1905.                          vice= line in CONFIG.SYS.
  1906.  
  1907.                          The /S  option may be extremely  useful for anyone
  1908.                          with multiple  similar systems  to maintain.   You
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.           CLOCK Version 3.52                              November 19, 1993
  1923.  
  1924.  
  1925.                          can set  up all  of your options  once on  one ma-
  1926.                          chine, save those with the /S option, and then use
  1927.                          the  saved  file to  directly  install on  all the
  1928.  
  1929.                          other machines.  If  you use password  protection,
  1930.                          no  one can  change  the other  systems  except by
  1931.                          modifying  CONFIG.SYS  to  remove the  loading  of
  1932.                          CLOCK.SYS.
  1933.  
  1934.                          You will  still need to  run CLK as part  of every
  1935.  
  1936.                          boot operation  (e.g., in AUTOEXEC.BAT)  to do any
  1937.                          automatic adjustment (A= and  L= functions), check
  1938.                          for clock failures (W= function), and check to see
  1939.                          whether the clock should use the standard  or day-
  1940.                          light offsets (TZ= function).  These functions are
  1941.                          not  processed automatically by  CLOCK.SYS because
  1942.  
  1943.                          they would  increase the size of the device driver
  1944.                          to an unacceptable limit.
  1945.  
  1946.                     /?
  1947.                          "/?" or any  error will cause  CLK to display  the
  1948.                          usage format.  If you have an error in any  field,
  1949.  
  1950.                          CLK first displays that field.
  1951.  
  1952.                     TZ=:?
  1953.                          "TZ=:?" or any error in a TZ= function that refers
  1954.                          to a  pre-defined time zone causes  CLK to display
  1955.                          all  the current pre-defined  time zone  names and
  1956.  
  1957.                          their associated values.
  1958.           B.Using CLK with WindowsIf you use the TZ= function  and also use
  1959.           WINDOWS, you  will  need to  modify your  SYSTEM.INI  file.   The
  1960.           SYSTEM.INI  file is  found in  your  WINDOWS directory.   WINDOWS
  1961.           performs a function very similar to the C=R function, but WINDOWS
  1962.           uses the  BIOS to  go directly  to the  hardware clock  and hence
  1963.  
  1964.           bypasses  CLOCK.SYS.    The  result  will  usually be  your  time
  1965.           changing everytime you enter WINDOWS.  
  1966.  
  1967.           Fortunately you  can avoid that  by editing the  SYSTEM.INI file.
  1968.           In the SYSTEM.INI file, find the line that looks like:
  1969.  
  1970.  
  1971.           [386Enh]
  1972.  
  1973.           Immediately after that line or anywhere in the  [386Enh] section,
  1974.           insert a line that looks like:
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.           CLOCK Version 3.52                              November 19, 1993
  1989.  
  1990.  
  1991.           SyncTime=false
  1992.           C.Format  of TZ= FunctionThe format of  TZ=... can get quite com-
  1993.           plicated  as the standard is  trying to deal  with all time zones
  1994.  
  1995.           and daylight  savings time  rules  around the  world.   The  full
  1996.           format is:
  1997.  
  1998.                TZ=:zone
  1999.                or
  2000.                TZ=STD[offset][DAY[offset][,start[/time],end[/time]]]
  2001.  
  2002.  
  2003.           Parameters     zone
  2004.                          The form TZ=:zone is  the one you are most  likely
  2005.                          to  need.  CLK knows the offsets and daylight sav-
  2006.                          ings time  rules for most of the  U.S. and all you
  2007.                          have to supply is the name of your time zone.  The
  2008.  
  2009.                          time zones currently known to CLK are:
  2010.                          EST  Eastern U.S. with automatic daylight
  2011.                          CST  Central U.S. with automatic daylight
  2012.                          MST  Mountain U.S. with automatic daylight
  2013.                          PST  Pacific U.S. with automatic daylight
  2014.                          HST  Hawaiian with no daylight savings time
  2015.  
  2016.                          MET  Mediterranean with automatic daylight
  2017.  
  2018.                          You can use CLK TZ=:? to display the list  of pre-
  2019.                          defined zone names and their values.
  2020.  
  2021.                          If you would like your favorite time added, please
  2022.  
  2023.                          send me the  names, offset from UTC,  and any day-
  2024.                          light savings  time rules that are  different from
  2025.                          the U.S.  NOTE:  The names can be composed of  any
  2026.                          characters except digits,  plus, minus, and comma.
  2027.                          They can  be up to  32 characters  long.  Case  is
  2028.                          preserved in  the names only for  later display by
  2029.  
  2030.                          CLK.  You can call your zone MyZone.
  2031.  
  2032.                          Case is not important in matching  the zone names.
  2033.                          tz=:cst  is the equivalent of  TZ=:CST.  Both will
  2034.                          find the definition of CST.
  2035.                                   
  2036.  
  2037.                     You don't have to wait for me to modify CLK in order to
  2038.                     use your local rules or just try something out.  That's
  2039.                     what the long form is for.
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.           CLOCK Version 3.52                              November 19, 1993
  2055.  
  2056.  
  2057.                     STD
  2058.                          is  any time zone name  for standard time that you
  2059.                          want to use.  See the note above for the rules.
  2060.  
  2061.  
  2062.  
  2063.                     offset
  2064.                          is  the difference between your local time and UTC
  2065.                          and is expressed as  hh[:mm[:ss]] with an optional
  2066.                          leading + or -.   Offsets for times West of Green-
  2067.  
  2068.                          wich are positive and those  East are negative.  A
  2069.                          24-hour  clock  is  used with  times  running from
  2070.                          00:00:00  to  23:59:59.   Mountain  Standard  time
  2071.                          would be expressed as:
  2072.                               TZ=MST+07:00:00
  2073.                                    or
  2074.  
  2075.                               TZ=MST7
  2076.                          and that's what you would use if you  live in Ari-
  2077.                          zona  and  don't  want any  daylight  savings time
  2078.                          adjustments.
  2079.  
  2080.                     DAY
  2081.  
  2082.                          is the  time zone name for  daylight savings time.
  2083.                          If you  don't use  daylight savings  time in  your
  2084.                          location, you should not supply this or any of the
  2085.                          following fields.
  2086.  
  2087.                          The offset for  daylight time is in  the same form
  2088.  
  2089.                          as  for standard  time.   If you  don't give  this
  2090.                          offset, it is  assumed to be  one hour later  than
  2091.                          standard time.  Thus a more complete specification
  2092.                          of the Eastern time zone would be:
  2093.                               TZ=EST+05:00:00EDT+04:00:00
  2094.                                    or
  2095.  
  2096.                               TZ=EST5EDT4
  2097.                                    or
  2098.                               TZ=EST5EDT     (since daylight  is  one  hour
  2099.                                              later by default)
  2100.  
  2101.                     start
  2102.  
  2103.                          is the day  of the year on which  daylight savings
  2104.                          time starts.  There are three formats that you can
  2105.                          use to give this day.  They are given below.
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.           CLOCK Version 3.52                              November 19, 1993
  2121.  
  2122.  
  2123.                     end
  2124.                          is  the day  of the  year on  which  standard time
  2125.                          starts again.   Note  that in  the Southern  hemi-
  2126.  
  2127.                          sphere it is quite possible for "end" to be earli-
  2128.                          er in  the year than  "start" as  daylight savings
  2129.                          time will include December and January.  end is in
  2130.                          the  same format as  start.  Note  from the syntax
  2131.                          above  that you  must provide  end if  you provide
  2132.                          start.
  2133.  
  2134.  
  2135.                     time
  2136.                          is the  time of day  that the change  takes place.
  2137.                          It  is in exactly the same format as offset except
  2138.                          that leading +  and - signs  are not allowed.   If
  2139.                          you  do not specify the time,  02:00:00 is used as
  2140.  
  2141.                          the default.
  2142.  
  2143.           The day of the year form for start and end may be any of:
  2144.  
  2145.                     Jn
  2146.                          where n is a Julian day of the year from 1 to 365.
  2147.  
  2148.                          This  form does not allow you to refer to February
  2149.                          29.   Day 59  is always February 28  and Day 60 is
  2150.                          always March 1.  This is most useful  in locations
  2151.                          where  a particular  calendar date  is  used every
  2152.                          year.
  2153.  
  2154.  
  2155.                     n
  2156.                          where n is a Julian day of the year from 0 to 365.
  2157.                          This form  does allow you to refer to February 29.
  2158.                          January 1  is day  0, February 28  is day  58, and
  2159.                          either February 29 or March 1 is day 59  depending
  2160.                          on whether it is a leap year or not.  Not the most
  2161.  
  2162.                          useful of  forms but  it does deal  with locations
  2163.                          that might specify  February 29  as the date  that
  2164.                          time changes.
  2165.  
  2166.                     Mm.w.d
  2167.                          is used in places like the U.S. that do not speci-
  2168.  
  2169.                          fy a  date, but rather  specify a rule.   m is the
  2170.                          month  (1  to  12).   d  is the  day  of  the week
  2171.                          (0=Sunday,  1=Monday, ...  6=Saturday).  w  is the
  2172.                          week of the month  (1 to 5).  Week 1 indicates the
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.           CLOCK Version 3.52                              November 19, 1993
  2187.  
  2188.  
  2189.                          first time that day d occurs in that month.   Week
  2190.                          5 indicates  the last  time that  day d occurs  in
  2191.                          that month  whether it  is the  4th  or 5th  time.
  2192.  
  2193.                          Thus the U.S. rule is
  2194.                               M4.1.0/02:00:00,M10.5.0/02:00:00
  2195.                          or the first Sunday in April at 2AM until the last
  2196.                          Sunday in October at 2AM.
  2197.  
  2198.           The long form for Central U.S. time is:
  2199.  
  2200.  
  2201.                TZ=CST+06:00:00CDT+05:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00
  2202.                          or
  2203.                TZ=CST6CDT5,M4.1.0/2,M10.5.0/2     (just leaving out zeros)
  2204.                          or
  2205.                TZ=CST6CDT,M4.1.0,M10.5.0          (since 2AM is default)
  2206.  
  2207.                          or
  2208.                TZ=CST6CDT                         (since  the U.S.  rule is
  2209.                                                   the default)
  2210.  
  2211.           D.Using CLKThe most common use of CLK will be to handle your time
  2212.           zone and daylight  savings time  changes.  You  need only do  the
  2213.  
  2214.           following:
  2215.  
  2216.           1.   Set your clocks to UTC.
  2217.  
  2218.           2.   Include the following line in your AUTOEXEC.BAT file.
  2219.                     CLK TZ=:zone   (where you  use one  of the  pre-defined
  2220.  
  2221.                                    zones)
  2222.                          or
  2223.                     CLK TZ=...     (where you define your own rules)
  2224.  
  2225.           That's it.  Everything else will take care of itself.  
  2226.  
  2227.  
  2228.           The only other time you will need to do anything is if you decide
  2229.           to correct your calendar clock to a more accurate time.  You will
  2230.           probably use TIMESET or  one of the other programs  that call the
  2231.           Naval Observatory or  NIST or maybe just your watch that you have
  2232.           set accurately.
  2233.  
  2234.  
  2235.           If you don't want to have to change the configuration of the time
  2236.           setting program, you  may want to  have it always  set UTC or  at
  2237.           least your  local standard time.  If you  want to have it set UTC
  2238.           time, do the following:
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.           CLOCK Version 3.52                              November 19, 1993
  2253.  
  2254.  
  2255.                CLK S=C C=W
  2256.                run your time set program
  2257.                CLK TZ=...     (your normal TZ value)
  2258.  
  2259.  
  2260.           The  C=W in the first  line is only required  if you normally run
  2261.           with the clocks disconnected.
  2262.  
  2263.           Note that if you tell the time set program what your current time
  2264.           zone is, you don't have to do anything unless you have the clocks
  2265.  
  2266.           disconnected.
  2267.  
  2268.           Notes     Leaving your clock on local time                    ________________________________
  2269.                     If you don't  want to  be bothered with  UTC, CLK  will
  2270.                     quite happily work with your calendar clock set to  its
  2271.                     current  value.   For example,  let's  assume that  you
  2272.  
  2273.                     currently have both clocks set to Pacific Standard Time
  2274.                     and you don't  really want to  be bothered changing  to
  2275.                     UTC, but you would like future changes between standard
  2276.                     and daylight time  to be  handled automatically.   Just
  2277.                     use the following statement in AUTOEXEC.BAT:
  2278.                          CLK TZ=PST0PDT
  2279.  
  2280.  
  2281.                     CLK believes whatever you tell it and will quite happi-
  2282.                     ly  operate assuming  that PST  is equal  to UTC.   You
  2283.                     could even  use  CLK with  your calendar  clock set  to
  2284.                     Pacific Daylight Time by using:
  2285.                          CLK TZ=PST1PDT
  2286.  
  2287.  
  2288.                     Avoiding missed days when your PC stays on all night,
  2289.                     and missed years and leap days on type 4 and 6 clocks                    _____________________________________________________
  2290.                     If your  PC is often left on over midnight and seems to
  2291.                     miss the change to a new day, use:
  2292.                          CLK C=R TZ=...
  2293.  
  2294.                     in your AUTOEXEC.BAT file to have CLOCK.SYS periodical-
  2295.                     ly read the time and date from the calendar clock.   If
  2296.                     your clock is a  type 4 or 6 clock  that doesn't update
  2297.                     years automatically and doesn't handle  leap days, then
  2298.                     this setting also  ensures that leaving your PC on over
  2299.                     the end of  a year or across February  29 doesn't cause
  2300.  
  2301.                     you to get the wrong date.
  2302.  
  2303.                     Using CLK.INI to simplify your commands                    _______________________________________
  2304.                     If you always use  the same functions, you may  want to
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.           CLOCK Version 3.52                              November 19, 1993
  2319.  
  2320.  
  2321.                     edit the CLK.INI file that is included in this release.
  2322.                     You  can include your TZ=, C=,  and R= functions in the
  2323.                     file and just use:
  2324.  
  2325.                          CLK /I
  2326.                     in your AUTOEXEC.BAT file.
  2327.  
  2328.                     Adding and subtracting time                    ___________________________
  2329.                     You can pretty much do anything including simple arith-
  2330.                     metic  on your  clocks by  using the  functions in  the
  2331.  
  2332.                     correct  sequence.  Let's  say that you  want to add 12
  2333.                     hours to the  current time in  both clocks because  you
  2334.                     inadvertently set  AM time  instead of  PM  time.   The
  2335.                     following function sequence will do that:
  2336.                          CLK TZ=Igoofed-12 S=D TZ=:pst
  2337.  
  2338.  
  2339.                     The TZ=Igoofed-12 (or use any other name  for the zone)
  2340.                     sets your DOS clock to 12 hours later than the calendar
  2341.                     clock.   (Yes, I know that time zone offsets seem back-
  2342.                     wards since you  subtract them from the  base time, but
  2343.                     that's the way the official standards have them.)
  2344.  
  2345.  
  2346.                     The S=D sets both clocks to  the value in the DOS clock
  2347.                     with a zero offset.
  2348.  
  2349.                     The TZ=:pst should be  replaced by whatever your normal
  2350.                     TZ  function is or even by a  /I to pull in your normal
  2351.                     settings.
  2352.  
  2353.  
  2354.                     If you normally have your clocks disconnected, insert a
  2355.                     C=W function as the first function.
  2356.  
  2357.                     Correcting inadvertent problems                    _______________________________
  2358.                     Just remember that except for the S=D function, CLK and
  2359.  
  2360.                     CLOCK.SYS always  start  with the  assumption that  the
  2361.                     calendar clock is  the base and  do all their  calcula-
  2362.                     tions from that point.   Thus you can play  with TZ and
  2363.                     other functions as much as you want and always get back
  2364.                     to  your normal local time just by using your normal TZ
  2365.                     command.  The calendar clock will not have been affect-
  2366.  
  2367.                     ed  unless you did  something to set  the time or date.
  2368.                     You can  avoid even that problem  by disconnecting your
  2369.                     clocks  (C=D) or  restricting time  changes (R=A).   In
  2370.                     fact, if you have trouble with some  program messing up
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.           CLOCK Version 3.52                              November 19, 1993
  2385.  
  2386.  
  2387.                     your clocks, try the following:
  2388.  
  2389.                          CLK C=D
  2390.  
  2391.                          execute program
  2392.                          CLK S=C C=W (or C=R) TZ=...  (your normal)
  2393.  
  2394.                     If you  have your standard  C= and  TZ= functions in  a
  2395.                     file, you can simplify this as:
  2396.  
  2397.  
  2398.                          CLK C=D
  2399.                          execute program
  2400.                          CLK S=C /I
  2401.  
  2402.                     You  may even  want to make  up batch  files containing
  2403.                     this  sequence to run those troublesome programs.  Some
  2404.  
  2405.                     games are major causes of problems because they set the
  2406.                     DOS  clock  running faster  or  slower  than normal  to
  2407.                     control the pace of the game.  As long  as they restore
  2408.                     the normal rate when they exit, the above sequence will
  2409.                     eliminate any clock drift problems.
  2410.  
  2411.  
  2412.                     Fast DOS clock drift                    ____________________
  2413.                     Some high-speed communication programs  will also cause
  2414.                     the DOS  clock to run slow by  causing the BIOS to miss
  2415.                     clock interrupts.  Fortunately,  a C=R function  should
  2416.                     virtually eliminate problems of this type.
  2417.  
  2418.  
  2419.           E.Examples     clk A=0.34
  2420.                     sets an adjustment factor of 0.34 seconds per day.  The
  2421.                     A=0.34  function will  be written  to the  CLK.INI file
  2422.                     along with an  L= function with the current  time and a
  2423.                     zero remaining adjustment.  Every time thereafter, that
  2424.                     CLK is run with the /I option, it will  check to see if
  2425.  
  2426.                     it  is time  to adjust the  clocks.   About every third
  2427.                     day, it will add 1 second to both clocks.
  2428.  
  2429.                clk s=c /i
  2430.                     sets  the DOS clock to  the current calendar clock time
  2431.                     without any  time zone adjustment.   The /i  causes all
  2432.  
  2433.                     functions  in the CLK.INI file to  be added.  If one of
  2434.                     them is a tz function, we have corrected the DOS  clock
  2435.                     for any changes made to it and re-established  our time
  2436.                     zone.  This is a good command line to use following a 
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.           CLOCK Version 3.52                              November 19, 1993
  2451.  
  2452.  
  2453.                          clk c=d
  2454.                     and other operations  that may have led to an incorrect
  2455.                     time in the DOS clock.
  2456.  
  2457.  
  2458.                clk c=r tz=:est r=b-00:00:02 r=f+00:00:02
  2459.                     sets CLOCK.SYS  to read the calendar  clock about every
  2460.                     10  seconds and re-synchronize  the DOS clock  with it;
  2461.                     applies the appropriate Eastern  time zone (standard or
  2462.                     daylight depending on  date); and prohibits changes  to
  2463.  
  2464.                     the clock of more than 2 seconds in either direction.
  2465.  
  2466.           F.ErrorsWhen errors are  detected, CLK prints a message.  It also
  2467.           sets the ERRORLEVEL on each program termination as follows:
  2468.  
  2469.           0    Normal termination or only warning messages.
  2470.  
  2471.  
  2472.           1    Time outside warning range.  Warning issued.
  2473.  
  2474.           2    Error in command line or  CLK.INI file functions.  The func-
  2475.                tion with the error is displayed followed by the appropriate
  2476.                usage rules.
  2477.  
  2478.  
  2479.           3    Internal error or system error (e.g., unable to open  handle
  2480.                to CLOCK.SYS).
  2481.  
  2482.           G.Future  EnhancementsSeveral enhancements are planned for future
  2483.           releases of CLK.
  2484.  
  2485.  
  2486.                -    Full screen interface that  displays the current status
  2487.                     of all the things that CLK and  CLOCK.SYS know and lets
  2488.                     you change them just by editing the screen.  The rather
  2489.                     clunky command  line interface needs  to remain as  its
  2490.                     compact  function definitions  are what  you want  in a
  2491.  
  2492.                     .BAT file.
  2493.  
  2494.                -    Direct dialing of the Naval  Observatory or NIST to get
  2495.                     the correct  time with automatic  creation of  M= func-
  2496.                     tions from the results.
  2497.           IV.CLKDEMO.EXEA  simple   version  of  the  CLK  program,  called
  2498.  
  2499.           CLKDEMO, is  provided in  both executable and  source code  form.
  2500.           CLKDEMO only provides support for the C= functions and displaying
  2501.           the  clock status.  It  is included to show  you how to add clock
  2502.           handling  to your own applications.  CLKDEMO  is written in C and
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.           CLOCK Version 3.52                              November 19, 1993
  2517.  
  2518.  
  2519.           is compiled with Microsoft C 5.1.
  2520.  
  2521.           A.CLKDEMO Command LineSyntax  CLKDEMO [C=A|D|R|W] [/?]
  2522.  
  2523.  
  2524.           The functions provided  work exactly as they do in  CLK.  CLKDEMO
  2525.           also displays the status and the current times.
  2526.  
  2527.           Since  CLKDEMO.EXE is merely a subset of CLK.EXE, it isn't terri-
  2528.           bly useful as a utility in its own  right.  Its value is that the
  2529.  
  2530.           source code  is  provided.   There are  three  source code  files
  2531.           provided.   CLKDEMO.C is  the main  program and performs  command
  2532.           interpretation and execution.  IOCTL.C is a set of functions that
  2533.           read  and  write the  CLOCK$ device  driver  using the  DOS IOCTL
  2534.           functions.   IOCTL.H is a  set of definitions  which are used  by
  2535.           CLKDEMO and  IOCTL.C.   CLKTYP.H is  a list  of  the clock  types
  2536.  
  2537.           currently supported by these programs.  It is used to display the
  2538.           type.
  2539.           V.IOCTL - API TO CLOCK.SYSIOCTL is provided to allow you to build
  2540.           your  own  applications  to  use  the additional  functions  that
  2541.           CLOCK.SYS   provides.    There   are  several  APIs  (Application
  2542.           Programming Interfaces) provided  as part of IOCTL.   These  APIs
  2543.  
  2544.           are sufficient to perform all of the extended functions.
  2545.  
  2546.           All  of the  APIs are defined  to be  directly callable  from all
  2547.           Microsoft compatible  languages including MASM,  FORTRAN, Pascal,
  2548.           and  BASIC.   Languages other than  C refer  to the  API names as
  2549.           upper case characters.  Object code versions are provided for the
  2550.  
  2551.           small,  medium, and  large memory  models.   These may  be linked
  2552.           directly with your  applications.  The  object code versions  are
  2553.           SIOCTL.OBJ, MIOCTL.OBJ, and LIOCTL.OBJ for the small, medium, and
  2554.           large models respectively.
  2555.  
  2556.           A.Data StructuresData structures are  defined in ioctl.h that are
  2557.  
  2558.           used in the calls to the IOCTL functions.
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.           CLOCK Version 3.52                              November 19, 1993
  2583.  
  2584.  
  2585.           /* "modes" holds flags that control the operation of CLOCK.SYS */
  2586.  
  2587.           struct modes {
  2588.  
  2589.               unsigned : 9;
  2590.               unsigned day_light: 1;
  2591.               unsigned disp_24 : 1;
  2592.               unsigned disp_tim : 1;
  2593.               unsigned pw_ena : 1;
  2594.               unsigned disabl : 1;
  2595.  
  2596.               unsigned chk_forw : 1;
  2597.               unsigned chk_back : 1;
  2598.           };
  2599.  
  2600.           /* "off" holds a time offset in hours, minutes, and seconds. */
  2601.  
  2602.  
  2603.           struct off {
  2604.               int hour;
  2605.               int minute;
  2606.               int second;
  2607.           };
  2608.  
  2609.  
  2610.           /* "date_time" is a structure that holds a date and time.    */
  2611.  
  2612.           struct date_time {
  2613.               int year;
  2614.               int month;
  2615.               int day;
  2616.  
  2617.               struct off time;
  2618.               int hsecond;
  2619.           };
  2620.  
  2621.           /* "time_zone" holds a time zone name and offset.   */
  2622.  
  2623.  
  2624.           struct time_zone {
  2625.               struct off offs;
  2626.               unsigned char zone[32];
  2627.           };
  2628.  
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.           CLOCK Version 3.52                              November 19, 1993
  2649.  
  2650.  
  2651.           /* "limit"  is used to  hold the data  that sets time  limits for
  2652.           changes.    */
  2653.  
  2654.  
  2655.           struct limit {
  2656.               struct off back;
  2657.               struct off forward;
  2658.           };
  2659.           /* "disp" is used  to hold the  data that specifies the  location
  2660.           and attributes of the continuous time display.   */
  2661.  
  2662.  
  2663.           struct disp {
  2664.               int x;
  2665.               int y;
  2666.               int attribute;
  2667.           };
  2668.  
  2669.  
  2670.           /* CLOCK_DATA  is the CLOCK.SYS  data that is  returned by clksta
  2671.           (AKA CLKSTA for  FORTRAN, Pascal, and BASIC  languages).  Because
  2672.           we need  to be  language independent, all  of the  data is  word-
  2673.           aligned.   Only the data types int  and character are used.  Some
  2674.           of the int data is encoded bits or addresses.  */
  2675.  
  2676.  
  2677.           struct CLOCK_DATA {
  2678.               int connected;               /* Connection state          */
  2679.               struct modes mode;           /* Mode bits                 */
  2680.               struct date_time cal_time;   /* Current date and time     */
  2681.               struct time_zone standard;   /* Offset of standard UTC    */
  2682.  
  2683.               struct time_zone daylight;   /* Daylight offset           */
  2684.               struct limit rules;          /* Maximum clock movement    */
  2685.               struct disp display;         /* Time display loc and attr */
  2686.               unsigned char vers[6];       /* CLOCK.SYS version nnn.nn  */
  2687.               int clock_type;              /* Type of clock installed   */
  2688.               int ct_1;                    /* Data for clock type       */
  2689.  
  2690.               int ct_2;
  2691.               int ct_3;
  2692.               int ct_4;
  2693.               unsigned int clock_seg;      /* Segment CLOCK.SYS loaded at*/
  2694.               unsigned int clock_long;     /* Size of CLOCK.SYS          */
  2695.           };
  2696.  
  2697.  
  2698.           This data structure is treated as the following integer array  in
  2699.           the FORTRAN and BASIC languages.
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.           CLOCK Version 3.52                              November 19, 1993
  2715.  
  2716.  
  2717.           BASIC          _____
  2718.                OPTION BASE 1
  2719.                DIM CDATA(66)
  2720.  
  2721.  
  2722.           FORTRAN          _______
  2723.                INTEGER*2 CDATA(66)
  2724.  
  2725.           ARRAY INDEX         CONTENTS                 STRUCTURE ELEMENT          ___________         ________                 _________________
  2726.  
  2727.  
  2728.           CDATA(1)       =    Connection state         connected
  2729.           CDATA(2)       =    Mode bits                mode
  2730.           CDATA(3)       =    Year from calendar clock cal_time.year
  2731.           CDATA(4)       =    Month                    cal_time.month
  2732.           CDATA(5)       =    Day                      cal_time.day
  2733.           CDATA(6)       =    Hour                     cal_time.offs.hour
  2734.  
  2735.           CDATA(7)       =    Minute                   cal_time.offs.minute
  2736.           CDATA(8)       =    Second                   cal_time.offs.second
  2737.           CDATA(9)       =    100th of second          cal_time.hsecond
  2738.           CDATA(10)      =    Standard hours from UTC  standard.offs.hour
  2739.           CDATA(11)      =    Standard minutes         standard.offs.minute
  2740.           CDATA(12)      =    Standard seconds         standard.offs.second
  2741.  
  2742.           CDATA(13) -                                  standard.zone
  2743.           CDATA(28)      =    Standard time zone LJSF
  2744.           CDATA(29)      =    Daylight hours from UTC  daylight.offs.hour
  2745.           CDATA(30)      =    Daylight minutes         daylight.offs.minute
  2746.           CDATA(31)      =    Daylight seconds         daylight.offs.second
  2747.           CDATA(32) -                                  daylight.zone
  2748.  
  2749.           CDATA(47)      =    Daylight time zone LJSF
  2750.           CDATA(48)      =    Maximum hours backward   rules.back.hour
  2751.           CDATA(49)      =    Maximum minutes backward rules.back.minute
  2752.           CDATA(50)      =    Maximum seconds backward rules.back.second
  2753.           CDATA(51)      =    Maximum hours forward    rules.forward.hour
  2754.           CDATA(52)      =    Maximum minutes forward  rules.forward.minute
  2755.  
  2756.           CDATA(53)      =    Maximum seconds forward  rules.forward.second
  2757.           CDATA(54)      =    x cursor position        display.x
  2758.           CDATA(55)      =    y cursor position        display.y
  2759.           CDATA(56)      =    attribute                display.attribute
  2760.           CDATA(57) -                                  vers
  2761.           CDATA(59)      =    CLOCK.SYS version LJSF
  2762.  
  2763.           CDATA(60)      =    Clock type               clock_type
  2764.           CDATA(61)      =    I/O address, base memory ct_1
  2765.                               segment, or base year
  2766.           CDATA(62)      =    Read memory offset       ct_2
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.           CLOCK Version 3.52                              November 19, 1993
  2781.  
  2782.  
  2783.           CDATA(63)      =    Write-0 memory offset    ct_3
  2784.           CDATA(64)      =    Write-1 memory offset    ct_4
  2785.           CDATA(65)      =    Segment address          clock_seg
  2786.  
  2787.                               where CLOCK.SYS is loaded
  2788.           CDATA(66)      =    Length of CLOCK.SYS      clock_long
  2789.  
  2790.           B.clksta■  Summary
  2791.  
  2792.           C          _
  2793.  
  2794.  
  2795.           #include <ioctl.h>
  2796.  
  2797.           extern int pascal far clksta(struct CLOCK_DATA *cdata);
  2798.  
  2799.           BASIC          _____
  2800.  
  2801.  
  2802.           OPTION BASE 1
  2803.           DIM CDATA(66)
  2804.  
  2805.           DECLARE FUNCTION CLKSTA%(BYVAL Addr AS INTEGER)
  2806.  
  2807.  
  2808.           STATUS% = CLKSTA(VARPTR(CDATA(1)))
  2809.  
  2810.           FORTRAN          _______
  2811.  
  2812.           INTEGER*2 CDATA(66)
  2813.           INTEGER*2 STATUS
  2814.  
  2815.           INTEGER*2 CLKSTA
  2816.  
  2817.           STATUS = CLKSTA(CDATA)
  2818.  
  2819.           ■  Description
  2820.  
  2821.  
  2822.           clksta  returns  all  of  the information  about  CLOCK.SYS  in a
  2823.           structure.   In FORTRAN and BASIC the  structure appears to be an
  2824.           integer array.  The above  structure declarations can be approxi-
  2825.           mated in  Pascal.  For a  description of the values  of each ele-
  2826.           ment,  see the individual APIs below.  The elements not described
  2827.           as part of the input to other functions are:
  2828.  
  2829.  
  2830.           unsigned char vers[6];      /* CLOCK.SYS version nnn.nn     */
  2831.           int clock_type;             /* Type of clock installed      */
  2832.           int ct_1;                   /* Data for clock type          */
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.           CLOCK Version 3.52                              November 19, 1993
  2847.  
  2848.  
  2849.           int ct_2;
  2850.           int ct_3;
  2851.           int ct_4;
  2852.  
  2853.           unsigned int clock_seg;     /* Segment CLOCK.SYS loaded at  */
  2854.           unsigned int clock_long;    /* Size of CLOCK.SYS            */
  2855.  
  2856.           CDATA(57) -
  2857.           CDATA(59)      =    CLOCK.SYS version LJSF characters
  2858.           CDATA(60)      =    Clock type (see type numbers in appendix B)
  2859.  
  2860.           CDATA(61)      =    I/O address,  base  memory segment,  or  base
  2861.                               year
  2862.           CDATA(62)      =    Read memory offset
  2863.           CDATA(63)      =    Write-0 memory offset
  2864.           CDATA(64)      =    Write-1 memory offset
  2865.           CDATA(65)      =    Segment address at which CLOCK.SYS is loaded
  2866.  
  2867.           CDATA(66)      =    Length in bytes of CLOCK.SYS
  2868.  
  2869.                vers or CDATA(57) - CDATA(59)
  2870.                     Is  the version  number of  the CLOCK.SYS  that is  in-
  2871.                     stalled.   This  is returned  as  a 6-character,  left-
  2872.                     justified, space-filled  (LJSF) character string.   For
  2873.  
  2874.                     example, "3.49  ".
  2875.  
  2876.                clock_type or CDATA(60)
  2877.                     Is the type number of the clock being used.  See Appen-
  2878.                     dix B for the type numbers.
  2879.  
  2880.  
  2881.                ct_1 or CDATA(61)
  2882.                     Is the value of the first clock parameter.  This is the
  2883.                     base I/O  address for I/O  bus clocks, the  base memory
  2884.                     segment address  for memory-mapped clocks,  or the base
  2885.                     year for the AT&T clocks.
  2886.  
  2887.  
  2888.                ct_2 or CDATA(62)
  2889.                     Is the read offset for memory-mapped clocks.
  2890.  
  2891.                ct_3 or CDATA(63)
  2892.                     Is the write 0-bits offset for memory-mapped clocks.
  2893.  
  2894.  
  2895.                ct_4 or CDATA(64)
  2896.                     Is the write 1-bits offset for memory-mapped clocks.
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.           CLOCK Version 3.52                              November 19, 1993
  2913.  
  2914.  
  2915.                clock_seg or CDATA(65)
  2916.                     Is the  segment address  at which CLOCK.SYS  is loaded.
  2917.                     CLOCK.SYS always starts at offset zero in this segment.
  2918.  
  2919.  
  2920.                clock_long or CDATA(66)
  2921.                     Is the length of CLOCK.SYS in bytes.
  2922.  
  2923.           ■ Arguments         cdata
  2924.                                    is a pointer to  a location to place the
  2925.  
  2926.                                    current    state     information    from
  2927.                                    CLOCK.SYS.
  2928.  
  2929.           ■  Return Value
  2930.  
  2931.           If clksta is successful, the  function returns 0.  Otherwise,  it
  2932.  
  2933.           returns a non-zero value and  _doserrno is set to the correspond-
  2934.           ing error code.  Possible values are:
  2935.  
  2936.                0001h     Invalid  function.    This  should  indicate  that
  2937.                          CLOCK.SYS is not  installed.  It is the error that
  2938.                          the DOS clock device driver would return  since it
  2939.  
  2940.                          doesn't handle these functions.
  2941.  
  2942.                0005h     Access denied.   Indicates that DOS would not open
  2943.                          a handle for read access.  You may not have enough
  2944.                          handles available.
  2945.  
  2946.  
  2947.                0006h     Invalid handle.  Should not happen.
  2948.  
  2949.                000Dh     Invalid data.  CLOCK.SYS reported a bad byte count
  2950.                          or  otherwise did not  process the request.   This
  2951.                          should not happen.
  2952.  
  2953.  
  2954.           C.setpw■ Summary
  2955.  
  2956.           C          _
  2957.  
  2958.           #include <ioctl.h>
  2959.  
  2960.  
  2961.           extern void pascal far setpw(unsigned char *pw);
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.           CLOCK Version 3.52                              November 19, 1993
  2979.  
  2980.  
  2981.           BASIC          _____
  2982.  
  2983.           DECLARE SUB SETPW(BYVAL S AS INTEGER)
  2984.  
  2985.  
  2986.           A$ = "MyPasswd"
  2987.           CALL SETPW(SADD(A$))
  2988.  
  2989.           Note that A$ must be at least 8 characters long.  Only the  first
  2990.           8 characters will be used.
  2991.  
  2992.  
  2993.           FORTRAN          _______
  2994.  
  2995.           CHARACTER*8 PW
  2996.  
  2997.           PW = "MyPasswd"
  2998.  
  2999.           CALL SETPW(PW)
  3000.  
  3001.           ■  Description
  3002.  
  3003.           The  setpw function sets  the password  to be used  on subsequent
  3004.           calls to any  of the following functions.   These functions auto-
  3005.  
  3006.           matically  supply  the  most  recent  password  when  they   call
  3007.           CLOCK.SYS.  You  need not ever  call setpw if  you are not  using
  3008.           password  protection.  CLOCK.SYS will only  check the password if
  3009.           password protection is enabled through the stmode function.
  3010.  
  3011.           ■ Arguments         pw
  3012.  
  3013.                                    is a  pointer  to the  password  string.
  3014.                                    This string should be  exactly 8 charac-
  3015.                                    ters long and must be at least 8 charac-
  3016.                                    ters long.  The password should also  be
  3017.                                    LJSF  as every character is significant.
  3018.                                    Case is significant in passwords.
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.           CLOCK Version 3.52                              November 19, 1993
  3045.  
  3046.  
  3047.           ■  Example
  3048.  
  3049.           #include <ioctl.h>
  3050.  
  3051.  
  3052.           main()
  3053.  
  3054.           {
  3055.                   unsigned char pw[9] = "MyPasswd";
  3056.  
  3057.  
  3058.           /* Set password to use on subsequent function calls.  */
  3059.  
  3060.                   setpw(pw);
  3061.  
  3062.           }
  3063.  
  3064.  
  3065.           D.connec■  Summary
  3066.  
  3067.           C          _
  3068.  
  3069.           #include <ioctl.h>
  3070.  
  3071.  
  3072.           extern int pascal far connec(int *conn);
  3073.  
  3074.           BASIC          _____
  3075.  
  3076.           DECLARE FUNCTION CONNEC%(CONN AS INTEGER)
  3077.  
  3078.  
  3079.           STATUS% = CONNEC(CONN)
  3080.  
  3081.           FORTRAN          _______
  3082.  
  3083.           INTEGER*2 CONN, STATUS, CONNEC
  3084.  
  3085.  
  3086.           STATUS = CONNEC(CONN)
  3087.  
  3088.           ■  Description
  3089.  
  3090.           The connec function  provides a means  of setting the  connection
  3091.           state of CLOCK.SYS.
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.           CLOCK Version 3.52                              November 19, 1993
  3111.  
  3112.  
  3113.           ■  Arguments   conn
  3114.                               specifies the new connection mode.   The val-
  3115.                               ues are:
  3116.  
  3117.                               0 = disconnected (C=D)
  3118.                               1 = connected for writes only (C=W)
  3119.                               2  = connected for  writes and periodic reads
  3120.                               (C=R)
  3121.                               3 = connected for all operations (C=A)
  3122.  
  3123.  
  3124.  
  3125.           ■ Return Value
  3126.  
  3127.           If  the return  value is zero,  the function  succeeded.   If the
  3128.           return value is non-zero, an error has occurred and  _doserrno is
  3129.           set to the corresponding error code.  Possible values are:
  3130.  
  3131.  
  3132.                0001h     Invalid  function.    This  should  indicate  that
  3133.                          CLOCK.SYS is not installed.   It is the error that
  3134.                          the DOS clock device driver  would return since it
  3135.                          doesn't handle these functions.
  3136.  
  3137.  
  3138.                0005h     Access denied.  Indicates that DOS would not  open
  3139.                          a handle for read access.  You may not have enough
  3140.                          handles available.
  3141.  
  3142.                0006h     Invalid handle.  Should not happen.
  3143.  
  3144.  
  3145.                000Dh     Invalid data.  CLOCK.SYS reported a bad byte count
  3146.                          or otherwise  did not process  the request.   This
  3147.                          should not happen.
  3148.  
  3149.  
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160.  
  3161.  
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.           CLOCK Version 3.52                              November 19, 1993
  3177.  
  3178.  
  3179.           ■  Example
  3180.  
  3181.           #include <stdio.h>
  3182.  
  3183.           #include <ioctl.h>
  3184.  
  3185.           main()
  3186.           {
  3187.                int conn_write = 1;
  3188.                int status;
  3189.  
  3190.  
  3191.           /* Set clock to connected for writes */
  3192.  
  3193.                status = connec(&conn_write);
  3194.                if (status)
  3195.                     printf("Error %X in connec\n", status);
  3196.  
  3197.           }
  3198.  
  3199.           E.newpw■  Summary
  3200.  
  3201.           C          _
  3202.  
  3203.  
  3204.           #include <ioctl.h>
  3205.  
  3206.           extern int pascal far newpw(unsigned char *pw);
  3207.  
  3208.           BASIC          _____
  3209.  
  3210.  
  3211.           DECLARE FUNCTION NEWPW%(BYVAL S AS INTEGER)
  3212.  
  3213.           A$ = "MyPasswd"
  3214.           STATUS% = NEWPW(SADD(A$))
  3215.  
  3216.           Note  that A$ must be at least 8 characters long.  Only the first
  3217.  
  3218.           8 characters will be used.
  3219.  
  3220.           FORTRAN          _______
  3221.  
  3222.           CHARACTER*8 PW
  3223.           INTEGER*2 STATUS, NEWPW
  3224.  
  3225.  
  3226.           PW = "MyPasswd"
  3227.           STATUS = NEWPW(PW)
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.           CLOCK Version 3.52                              November 19, 1993
  3243.  
  3244.  
  3245.           ■  Description
  3246.  
  3247.           The  newpw  function sets  a new  password  for CLOCK.SYS.   This
  3248.  
  3249.           function  is not sufficient  to enable password  protection.  You
  3250.           must  also use stmode to  turn on password checking.   BE SURE to
  3251.           use newpw before you use stmode to turn on password checking.  If
  3252.           you turn on password checking without first  setting the password
  3253.           to something that  you know, you  will never be  able to use  the
  3254.           CLOCK.SYS functions again until you reboot.
  3255.  
  3256.  
  3257.           ■ Arguments         pw
  3258.                                    is  a pointer  to  the password  string.
  3259.                                    This string should  be exactly 8 charac-
  3260.                                    ters long and must be at least 8 charac-
  3261.                                    ters long.  The  password should also be
  3262.  
  3263.                                    LJSF as every  character is significant.
  3264.                                    Case is significant in passwords.
  3265.  
  3266.           ■ Return Value
  3267.  
  3268.           If the  return value  is zero,  the function  succeeded.  If  the
  3269.  
  3270.           return value is  non-zero, an error has occurred and _doserrno is
  3271.           set to the corresponding error code.  Possible values are:
  3272.  
  3273.                0001h     Invalid  function.    This  should  indicate  that
  3274.                          CLOCK.SYS is not installed.  It  is the error that
  3275.                          the DOS clock device driver  would return since it
  3276.  
  3277.                          doesn't handle these functions.
  3278.  
  3279.                0005h     Access denied.  Indicates that DOS would not  open
  3280.                          a handle for read access.  You may not have enough
  3281.                          handles available.
  3282.  
  3283.  
  3284.                0006h     Invalid handle.  Should not happen.
  3285.  
  3286.                000Dh     Invalid data.  CLOCK.SYS reported a bad byte count
  3287.                          or otherwise  did not process  the request.   This
  3288.                          should not happen.
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.           CLOCK Version 3.52                              November 19, 1993
  3309.  
  3310.  
  3311.           ■  Example
  3312.  
  3313.           #include <stdio.h>
  3314.  
  3315.           #include <ioctl.h>
  3316.  
  3317.           main()
  3318.  
  3319.           {
  3320.                   unsigned char pw[9] = "MyPasswd";
  3321.  
  3322.                  int status;
  3323.  
  3324.           /* Set new password for CLOCK.SYS  */
  3325.  
  3326.                   status = setpw(pw);
  3327.                  if (status)
  3328.  
  3329.                     printf("Error %X in setpw\n", status);
  3330.  
  3331.           }
  3332.  
  3333.           F.rstrct■  Summary
  3334.  
  3335.  
  3336.           C          _
  3337.  
  3338.           #include <ioctl.h>
  3339.  
  3340.           extern int pascal far rstrct(int *bhour, int *bmin, int *bsec,
  3341.               int *fhour, int *fmin, int *fsec);
  3342.  
  3343.  
  3344.           BASIC          _____
  3345.  
  3346.           DECLARE  FUNCTION RSTRCT%(BHOUR%,  BMIN%,  BSEC%, FHOUR%,  FMIN%,
  3347.           FSEC%)
  3348.  
  3349.  
  3350.           FORTRAN          _______
  3351.  
  3352.           INTEGER*2 BHOUR, BMIN, BSEC, FHOUR, FMIN, FSEC
  3353.           INTEGER*2 RSTRCT
  3354.  
  3355.           STATUS = RSTRCT(BHOUR, BMIN, BSEC, FHOUR, FMIN, FSEC)
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.           CLOCK Version 3.52                              November 19, 1993
  3375.  
  3376.  
  3377.           ■  Description
  3378.  
  3379.           The rstrct  function sets backwards  and forwards limits  on time
  3380.  
  3381.           changes.   Any time  changes  that exceed  these limits  will  be
  3382.           ignored.  For example,  if a backward limit of 2  seconds is set,
  3383.           no change that would move the clock backwards more than 2 seconds
  3384.           will be processed.  Setting the limits protects you agains keying
  3385.           in a bad time  and agains programs  that may incorrectly set  the
  3386.           time.   Yet you can still  change the time  within the prescribed
  3387.  
  3388.           limits.  For example, you  may set a backward limit of  2 seconds
  3389.           to permit CLK to adjust the time by up to  2 seconds while inhib-
  3390.           iting  any other backwards changes.   These limits have no effect
  3391.           on changing between  standard and daylight  times as that is  not
  3392.           really a change in the "time".
  3393.  
  3394.  
  3395.           ■ Arguments         bhour:bmin:bsec
  3396.                                    is the backward limit  in hours, minutes
  3397.                                    and seconds.
  3398.  
  3399.                               fhour:fmin:fsec
  3400.                                    is the forward limit in hours,  minutes,
  3401.  
  3402.                                    and seconds.
  3403.  
  3404.           ■ Return Value
  3405.  
  3406.           If  the return  value is  zero, the  function succeeded.   If the
  3407.           return value is non-zero, an error has occurred  and _doserrno is
  3408.  
  3409.           set to the corresponding error code.  Possible values are:
  3410.  
  3411.                0001h     Invalid  function.    This  should  indicate  that
  3412.                          CLOCK.SYS  is not installed.  It is the error that
  3413.                          the DOS  clock device driver would return since it
  3414.                          doesn't handle these functions.
  3415.  
  3416.  
  3417.                0005h     Access denied.  Indicates that  DOS would not open
  3418.                          a handle for read access.  You may not have enough
  3419.                          handles available.
  3420.  
  3421.                0006h     Invalid handle.  Should not happen.
  3422.  
  3423.  
  3424.                000Dh     Invalid data.  CLOCK.SYS reported a bad byte count
  3425.                          or otherwise  did not  process the request.   This
  3426.                          should not happen.
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.           CLOCK Version 3.52                              November 19, 1993
  3441.  
  3442.  
  3443.  
  3444.           ■  Example
  3445.  
  3446.  
  3447.           #include <stdio.h>
  3448.           #include <ioctl.h>
  3449.  
  3450.           main()
  3451.  
  3452.           {
  3453.  
  3454.                int bhour = 0;
  3455.                int bmin = 0;
  3456.                int bsec = 2;
  3457.                int fhour = 1;
  3458.                int fmin = 0;
  3459.                int fsec = 0;
  3460.  
  3461.                int status;
  3462.  
  3463.           /*  Set time  change  limits to  2 seconds  backwards and  1 hour
  3464.           forwards  */
  3465.  
  3466.                status = rstrct(&bhour, &bmin, &bsec, &fhour, &fmin, &fsec);
  3467.  
  3468.                if (status)
  3469.                     printf("Error %X in rstrct\n", status);
  3470.                else
  3471.                     printf("Time limits set to "
  3472.                          "-%.2d:%.2d:%.2d,+%.2d:%.2d:%.2d\n",
  3473.                          bhour, bmin, bsec, fhour, fmin, fsec);
  3474.  
  3475.           }
  3476.  
  3477.           G.stmode■  Summary
  3478.  
  3479.           C          _
  3480.  
  3481.  
  3482.           #include <ioctl.h>
  3483.  
  3484.           extern int pascal far stmode(struct modes *mode);
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.           CLOCK Version 3.52                              November 19, 1993
  3507.  
  3508.  
  3509.           BASIC          _____
  3510.  
  3511.           DECLARE FUNCTION STMODE%(MODES%)
  3512.  
  3513.  
  3514.           FORTRAN          _______
  3515.  
  3516.           INTEGER*2 MODES
  3517.           INTEGER*2 STMODE
  3518.  
  3519.  
  3520.           STATUS = STMODE(MODES)
  3521.  
  3522.           ■  Description
  3523.  
  3524.           The stmode  function sets  a  variety of  operating modes.    The
  3525.           argument  is actually a  structure of  bits.  Each  bit specifies
  3526.  
  3527.           whether an operating mode is on (1) or off (0).
  3528.  
  3529.           ■ Arguments         modes
  3530.                                    is  set of  bits that  specify operating
  3531.                                    modes.  The bit values are:
  3532.  
  3533.  
  3534.                                    unsigned : 9;            Unused
  3535.                                    unsigned day_light: 1;   0x0200 (512)
  3536.                                    unsigned disp_24 : 1;    0x0400 (1024)
  3537.                                    unsigned disp_tim : 1;   0x0800 (2048)
  3538.                                    unsigned pw_ena : 1;     0x1000 (4096)
  3539.                                    unsigned disabl : 1;     0x2000 (8192)
  3540.  
  3541.                                    unsigned chk_forw : 1;   0x4000 (16384)
  3542.                                    unsigned chk_back : 1;   0x8000 (32768)
  3543.  
  3544.           ■ Return Value
  3545.  
  3546.           If the  return value  is zero,  the function  succeeded.   If the
  3547.  
  3548.           return value is non-zero, an error has occurred and  _doserrno is
  3549.           set to the corresponding error code.  Possible values are:
  3550.  
  3551.                0001h     Invalid  function.    This  should  indicate  that
  3552.                          CLOCK.SYS is not  installed.  It is the error that
  3553.                          the  DOS clock device driver would return since it
  3554.  
  3555.                          doesn't handle these functions.
  3556.  
  3557.                0005h     Access denied.  Indicates  that DOS would not open
  3558.                          a handle for read access.  You may not have enough
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.           CLOCK Version 3.52                              November 19, 1993
  3573.  
  3574.  
  3575.                          handles available.
  3576.  
  3577.                0006h     Invalid handle.  Should not happen.
  3578.  
  3579.  
  3580.                000Dh     Invalid data.  CLOCK.SYS reported a bad byte count
  3581.                          or otherwise did  not process the  request.   This
  3582.                          should not happen.
  3583.  
  3584.  
  3585.  
  3586.           ■  Example
  3587.  
  3588.           #include <ioctl.h>
  3589.  
  3590.           main()
  3591.  
  3592.  
  3593.           {
  3594.                struct CLOCK_DATA cdata;
  3595.  
  3596.           /* Set daylight savings time.  */
  3597.  
  3598.                clksta(&cdata);            /* Get current mode settings. */
  3599.  
  3600.  
  3601.                cdata.mode.day_light = 1;  /* Turn on daylight */
  3602.  
  3603.                stmode(&cdata.modes);
  3604.           }
  3605.  
  3606.  
  3607.           H.stzone■  Summary
  3608.  
  3609.           C          _
  3610.  
  3611.           #include <ioctl.h>
  3612.  
  3613.  
  3614.           extern int pascal far stzone(int *shour, int *smin, int *ssec,
  3615.               unsigned char sname[32], int *dhour, int *dmin,
  3616.               int *dsec, unsigned char dname[32]);
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.           CLOCK Version 3.52                              November 19, 1993
  3639.  
  3640.  
  3641.           BASIC          _____
  3642.  
  3643.           DECLARE  FUNCTION  STZONE%(SHOUR%,  SMIN%,  SSEC%,  BYVAL  SN  AS
  3644.  
  3645.           INTEGER, DHOUR%, DMIN%, DSEC%, BYVAL DN AS INTEGER)
  3646.  
  3647.           SNAME$ = "32-CHARACTER STANDARD ZONE NAME "
  3648.           DNAME$ = "Daylight savings time zone name "
  3649.  
  3650.           STATUS% = STZONE(6,0,0,SADD(SNAME$),5,0,0,SADD(DNAME$))
  3651.  
  3652.  
  3653.           FORTRAN          _______
  3654.  
  3655.           CHARACTER*32 SNAME, DNAME
  3656.           INTEGER*2 STZONE, STATUS
  3657.  
  3658.  
  3659.           SNAME = "CST"
  3660.           DNAME = "CDT"
  3661.           STATUS = STZONE(6, 0, 0, SNAME, 5, 0, 0, DNAME)
  3662.  
  3663.           ■  Description
  3664.  
  3665.  
  3666.           The stzone function  sets the standard time and  daylight savings
  3667.           time offsets from  the calendar clock  and the standard and  day-
  3668.           light time zone  names or mnemonics.   Note that the  offsets are
  3669.           subtracted from the calendar  clock to get the local  time.  Thus
  3670.           the standard time offset from UTC to EST is 5:0:0.
  3671.  
  3672.  
  3673.           ■ Arguments         SHOUR:SMIN:SSEC
  3674.                                    is the time difference  between the cal-
  3675.                                    endar clock and local standard time.  It
  3676.                                    may be a positive of negative value.  If
  3677.                                    negative, all three values must be nega-
  3678.                                    tive.
  3679.  
  3680.  
  3681.                               SNAME
  3682.                                    is the  standard time zone name  or mne-
  3683.                                    monic.  It  must be a 32-character  LJSF
  3684.                                    character  string.   As  with  all other
  3685.                                    character  strings used  by these  func-
  3686.  
  3687.                                    tions,  there  is  no  terminating  NULL
  3688.                                    character as  is usual in C.   The other
  3689.                                    languages do  not  readily  handle  NULL
  3690.                                    terminated strings.   In C  applications
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.           CLOCK Version 3.52                              November 19, 1993
  3705.  
  3706.  
  3707.                                    you  may define  the character  array to
  3708.                                    contain  33  characters,  but  you  must
  3709.                                    ensure that the NULL character does  not
  3710.  
  3711.                                    occur in the first 32 characters.
  3712.  
  3713.                               DHOUR:DMIN:DSEC
  3714.                                    is the time  difference between the cal-
  3715.                                    endar clock and  local daylight  savings
  3716.                                    time.   Whether the  standard offset  or
  3717.  
  3718.                                    the daylight offset is currently used by
  3719.                                    CLOCK.SYS is  controlled by  the setting
  3720.                                    of the day_light mode bit (see stmode).
  3721.  
  3722.                               DNAME
  3723.                                    is the  daylight savings time  zone name
  3724.  
  3725.                                    or mnemonic.  It must  be a 32-character
  3726.                                    LJSF character string.
  3727.  
  3728.           ■ Return Value
  3729.  
  3730.           If the  return value  is zero,  the function  succeeded.  If  the
  3731.  
  3732.           return value is  non-zero, an error has occurred and _doserrno is
  3733.           set to the corresponding error code.  Possible values are:
  3734.  
  3735.                0001h     Invalid  function.    This  should  indicate  that
  3736.                          CLOCK.SYS is not installed.  It  is the error that
  3737.                          the DOS clock device driver  would return since it
  3738.  
  3739.                          doesn't handle these functions.
  3740.  
  3741.                0005h     Access denied.  Indicates that DOS would not  open
  3742.                          a handle for read access.  You may not have enough
  3743.                          handles available.
  3744.  
  3745.  
  3746.                0006h     Invalid handle.  Should not happen.
  3747.  
  3748.                000Dh     Invalid data.  CLOCK.SYS reported a bad byte count
  3749.                          or otherwise  did not process  the request.   This
  3750.                          should not happen.
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.           CLOCK Version 3.52                              November 19, 1993
  3771.  
  3772.  
  3773.           ■  Example
  3774.  
  3775.           #include <stdio.h>
  3776.  
  3777.           #include <ioctl.h>
  3778.  
  3779.           main()
  3780.  
  3781.           {
  3782.                unsigned char sname[33] = "PST                    ";
  3783.  
  3784.                unsigned char dname[33] = "PDT                    ";
  3785.                int shour = 8;
  3786.                int smin = 0;
  3787.                int ssec = 0;
  3788.                int dhour = 7;
  3789.                int dmin = 0;
  3790.  
  3791.                int dsec = 0;
  3792.                struct CLOCK_DATA cdata;
  3793.  
  3794.           /* Get current status.   */
  3795.  
  3796.                clksta(&cdata);
  3797.  
  3798.  
  3799.           /* Set time zone to U.S. Pacific time.  */
  3800.  
  3801.                stzone(&shour, &smin, &ssec, sname, &dhour, &dmin, &dsec,
  3802.                    dname);
  3803.  
  3804.  
  3805.           /* Select daylight savings time.  */
  3806.  
  3807.                cdata.mode.day_light = 1;
  3808.                stmode(&cdata.mode);
  3809.           }
  3810.  
  3811.  
  3812.           I.tdisp■  Summary
  3813.  
  3814.           C          _
  3815.  
  3816.           #include <ioctl.h>
  3817.  
  3818.  
  3819.           extern int pascal far tdisp(int *dispx, int *dispy, int *attr);
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.           CLOCK Version 3.52                              November 19, 1993
  3837.  
  3838.  
  3839.           BASIC          _____
  3840.  
  3841.           DECLARE FUNCTION TDISP%(DISPX%, DISPY%, ATTR%)
  3842.  
  3843.  
  3844.           STATUS% = TDISP(72, 0, &H79)
  3845.  
  3846.           FORTRAN          _______
  3847.  
  3848.           INTEGER*2 TDISP, STATUS
  3849.  
  3850.  
  3851.           STATUS = TDISP(0, 72, 0x79)
  3852.  
  3853.           ■  Description
  3854.  
  3855.           The tdisp  function sets the  coordinates and  attribute for  the
  3856.  
  3857.           continuous  time display.    tdisp  does not  start  or stop  the
  3858.           continuous  display nor does it set  the 12-hour or 24-hour mode.
  3859.           Those are all provided by the stmode function.
  3860.  
  3861.           ■ Arguments         DISPX
  3862.                                    is the x  (horizontal) cursor coordinate
  3863.  
  3864.                                    for  the continuous  time display.   The
  3865.                                    rightmost character on a line is at x=0.
  3866.                                    Be sure to leave enough space at the end
  3867.                                    of the line to accommodate the entire 8-
  3868.                                    chararacter time display.   For example,
  3869.                                    x=72 is the last position to  specify on
  3870.  
  3871.                                    an 80-character line.
  3872.  
  3873.                               DISPY
  3874.                                    is  the y  (vertical) cursor  coordinate
  3875.                                    for  the continuous  time display.   The
  3876.                                    top line on the display is y=0.
  3877.  
  3878.  
  3879.                               ATTR
  3880.                                    is the display attribute  to use for the
  3881.                                    continuous time display.  ATTR is usual-
  3882.                                    ly  expressed as  two  hex digits.   The
  3883.                                    first  (high-order) digit  is the  back-
  3884.  
  3885.                                    ground  color (0  to 7)  and the  second
  3886.                                    digit is the text or foreground color (0
  3887.                                    to  F).   For example, 0A  would display
  3888.                                    bright  green letters  on a  black back-
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.  
  3902.           CLOCK Version 3.52                              November 19, 1993
  3903.  
  3904.  
  3905.                                    ground.   Background  colors usually  do
  3906.                                    not  include the  bright  colors.    The
  3907.                                    color numbers are:
  3908.  
  3909.  
  3910.                                         0    Black
  3911.                                         1    Blue
  3912.                                         2    Green
  3913.                                         3    Cyan
  3914.                                         4    Red
  3915.  
  3916.                                         5    Magenta
  3917.                                         6    Brown
  3918.                                         7    White
  3919.                                         8    Grey
  3920.                                         9    Bright blue
  3921.                                         A    Bright green
  3922.  
  3923.                                         B    Brigth cyan
  3924.                                         C    Bright red
  3925.                                         D    Bright magenta
  3926.                                         E    Yellow
  3927.                                         F    Bright White
  3928.  
  3929.  
  3930.           ■ Return Value
  3931.  
  3932.           If  the return  value is zero,  the function  succeeded.   If the
  3933.           return value  is non-zero, an error has occurred and _doserrno is
  3934.           set to the corresponding error code.  Possible values are:
  3935.  
  3936.  
  3937.                0001h     Invalid  function.    This  should  indicate  that
  3938.                          CLOCK.SYS is not  installed.  It is the error that
  3939.                          the DOS clock device driver would return since  it
  3940.                          doesn't handle these functions.
  3941.  
  3942.                0005h     Access denied.  Indicates  that DOS would not open
  3943.  
  3944.                          a handle for read access.  You may not have enough
  3945.                          handles available.
  3946.  
  3947.                0006h     Invalid handle.  Should not happen.
  3948.  
  3949.                000Dh     Invalid data.  CLOCK.SYS reported a bad byte count
  3950.  
  3951.                          or otherwise  did not process  the request.   This
  3952.                          should not happen.
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.           CLOCK Version 3.52                              November 19, 1993
  3969.  
  3970.  
  3971.           ■  Example
  3972.  
  3973.           #include <stdio.h>
  3974.  
  3975.           #include <ioctl.h>
  3976.  
  3977.           main()
  3978.  
  3979.           {
  3980.                struct CLOCK_DATA cdata;
  3981.  
  3982.                int dispx = 72;
  3983.                int dispy = 0;
  3984.                int attr = 0x79;
  3985.  
  3986.           /* Get current CLOCK.SYS modes.  */
  3987.  
  3988.  
  3989.                clksta(&cdata);
  3990.  
  3991.           /* Turn on 12-hour display at end of top line of screen. 
  3992.              Use bright blue text on a white backgroun.          */
  3993.  
  3994.                tdisp(&dispx, &dispy, &attr);
  3995.  
  3996.                cdata.mode.disp_tim = 1;
  3997.                cdata.mode.disp_24 = 0;
  3998.                stmode(&cdata.mode);
  3999.  
  4000.           }
  4001.           VI.CLOCK.SYS -  ASSEMBLY LANGUAGE  APICLOCK.SYS has  a couple  of
  4002.  
  4003.           additional APIs (Application Programming Interfaces) that are not
  4004.           present in the normal DOS CLOCK$ device driver.  These interfaces
  4005.           are provided  by the  DOS IOCTL  (Input/Output  of ConTroL  data)
  4006.           functions.   The Output Control Data to Character Device function
  4007.           is used to set new operating values for CLOCK.SYS for the C=, D=,
  4008.           R=, TZ=, and /P functions.  The Input Control Data from Character
  4009.  
  4010.           Device  function is used  to get the current  status and the date
  4011.           and time from the calendar clock.
  4012.  
  4013.           A.Opening the  CLOCK$ DeviceIn order  to use the  additional APIs
  4014.           provided by CLOCK.SYS you must open a handle to the CLOCK$ device
  4015.           driver.  You do this using the DOS  INT 21H Open File with Handle
  4016.  
  4017.           (3DH)  function specifying read-write  access.  You  then use the
  4018.           handle to  invoke the other functions.   Sample assembly language
  4019.           is:
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.           CLOCK Version 3.52                              November 19, 1993
  4035.  
  4036.  
  4037.                MOV  AX,3D00H            ; Open with read and write access
  4038.                MOV  DX,OFFSET filename  ; Pointer to "CLOCK$" ASCIIZ string
  4039.                                         ; DS:DX must point to the string
  4040.  
  4041.                INT  21H                 ; Call DOS function handler
  4042.           ;    AX contains the handle on return if carry flag is not set.
  4043.  
  4044.           B.Sending  New  Values   to  CLOCK.SYSTo  change  the   state  of
  4045.           CLOCK.SYS,  you  use the  Send Control  Data to  Character Device
  4046.           (4403H) DOS  function.  You  send data to specify  the connection
  4047.  
  4048.           type,  modes,   time  zone  offsets   and  names,   restrictions,
  4049.           continuous  display information, and password.   You may send any
  4050.           combination  of these in  any order.   You  must always  send the
  4051.           current password  as the first 8 bytes.   If password checking is
  4052.           not  enabled, it doesn't matter what the 8 bytes contain, but you
  4053.           must still send the 8 bytes.
  4054.  
  4055.  
  4056.           The  data stream  that  you send  to  CLOCK.SYS  consists of  the
  4057.           current password followed by a selection index, the data for that
  4058.           selection, another selection index, its data, and so on.
  4059.  
  4060.           The selection  indices and the  data stream associated  with each
  4061.  
  4062.           one are:
  4063.  
  4064.           INDEX     DATA ITEMS     COMMENTS          _____     __________     ________
  4065.  
  4066.           1         connected      two  byte   integer  (0 : C=D,  1 : C=W,
  4067.                                    2 : C=R, 3 : C=A)
  4068.  
  4069.  
  4070.           2         mode           two byte  integer (see stmode for  a de-
  4071.                                    scription of the bits)
  4072.  
  4073.           3         standard       time_zone structure for standard time
  4074.                     daylight       time_zone structure for daylight time
  4075.  
  4076.  
  4077.           4         rules          limits structure
  4078.  
  4079.           5         display        disp structure
  4080.  
  4081.           6         password       8 bytes LJSF of new password
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.           CLOCK Version 3.52                              November 19, 1993
  4101.  
  4102.  
  4103.           Sample assembly language to send new information to CLOCK.SYS:
  4104.  
  4105.           curpw     DB   8 dup(?)       ; Current password
  4106.  
  4107.                     DW   1              ; Change connection
  4108.                     DW   2              ;  to C=R
  4109.                     DW   4              ; Change limits
  4110.                     DW   0,0,2,1,0,0    ;  to R=B-::2,F+1
  4111.                     DW   6              ; Set new password
  4112.                     DB   "MyPasswd"     ;  to MyPasswd (case is important)
  4113.  
  4114.                     DW   2              ; Change modes
  4115.                     DW   0D000H         ;  to enable limits and password
  4116.                                         ;  also sets standard time and 
  4117.                                         ;  no display
  4118.           count     equ $-curpw         ; Length to send
  4119.                ...
  4120.  
  4121.                     MOV  AX,4403H       ; Send control data function
  4122.                     MOV  BX,handle      ; Value returned from open
  4123.                     MOV  CX,count       ; Value = number of bytes to send
  4124.                     MOV  DX,OFFSET curpw ; Location of bytes to be sent
  4125.                                         ; DS:DX must point to the buffer
  4126.                     INT  21H            ;
  4127.  
  4128.           ; OK if carry not set.  CX will equal bytes actually taken.
  4129.  
  4130.           C.Getting Current  Status of CLOCK.SYSTo  get the current  status
  4131.           and time,  you use the Receive Control Data from Character Device
  4132.           (4402H) function.   You can read all of  the CLOCK_DATA structure
  4133.           or any smaller amount of it that  you need, but you can only read
  4134.  
  4135.           starting at the beginning
  4136.  
  4137.           Sample assembly language for reading the clock status is:
  4138.  
  4139.                MOV  AX,440CH            ; Read control data function
  4140.                MOV  BX,handle           ; Value returned from open
  4141.  
  4142.                MOV  CX,count            ; Number of bytes to read
  4143.                MOV  DX,OFFSET buffer    ; Location to store the data
  4144.                                         ; DS:DX must point to the buffer
  4145.                INT  21H                 ; Call DOS
  4146.           ; Data returned if carry not set.
  4147.           ; CX will contain the actual number of bytes transferred.
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.           CLOCK Version 3.52                              November 19, 1993
  4167.  
  4168.  
  4169.           APPENDIX A:  DEFINITION OF SHAREWARE
  4170.  
  4171.           Shareware  distribution  gives  users a  chance  to  try software
  4172.  
  4173.           before  buying it.  If you try  a Shareware  program and continue
  4174.           using  it, you  are  expected  to register.  Individual  programs
  4175.           differ  on  details --  some  request  registration while  others
  4176.           require it, some specify a maximum trial period.   With registra-
  4177.           tion,  you get anything from  the simple right  to continue using
  4178.           the software to an updated program with printed manual.
  4179.  
  4180.  
  4181.           Copyright laws apply  to both Shareware and  commercial software,
  4182.           and the copyright  holder retains all rights, with a few specific
  4183.           exceptions  as stated below.  Shareware authors  are accomplished
  4184.           programmers, just  like commercial authors, and  the programs are
  4185.           of comparable  quality. (In both  cases, there are  good programs
  4186.  
  4187.           and bad ones!) The main difference  is in the method of distribu-
  4188.           tion.  The  author  specifically grants  the  right  to copy  and
  4189.           distribute the software, either to all and sundry or to a specif-
  4190.           ic group. For  example, some  authors require written  permission
  4191.           before a commercial disk vendor may copy their Shareware.
  4192.  
  4193.  
  4194.           Shareware  is a distribution method, not  a type of software. You
  4195.           should  find software  that  suits  your  needs  and  pocketbook,
  4196.           whether it's  commercial or Shareware. The Shareware system makes
  4197.           fitting your  needs easier, because you  can try before  you buy.
  4198.           And because the  overhead is low, prices are  low also. Shareware
  4199.           has the  ultimate money-back guarantee  -- if  you don't use  the
  4200.  
  4201.           product, you don't pay for it.
  4202.  
  4203.           DISCLAIMER - AGREEMENT
  4204.  
  4205.           Users  of CLOCK must accept this  disclaimer of warranty:  "CLOCK
  4206.           is supplied  as is.   The  author disclaims  all warranties,  ex-
  4207.  
  4208.           pressed or implied, including, without limitation, the warranties
  4209.           of merchantability  and of fitness for  any purpose.   The author
  4210.           assumes no liability for damages, direct  or consequential, which
  4211.           may result from the use of CLOCK."
  4212.  
  4213.           CLOCK is a  "shareware program" and is  provided at no charge  to
  4214.  
  4215.           the  user for  evaluation.   Feel  free  to  share it  with  your
  4216.           friends, but please  do not give  it away altered  or as part  of
  4217.           another  system.  The essence of  "user-supported" software is to
  4218.           provide  personal computer  users with  quality software  without
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.           CLOCK Version 3.52                              November 19, 1993
  4233.  
  4234.  
  4235.           high  prices, and  yet to  provide incentive  for programmers  to
  4236.           continue  to develop  new  products.   If you  find  this program
  4237.           useful  and find  that you  are using CLOCK  and continue  to use
  4238.  
  4239.           CLOCK after a reasonable trial period, you must make  a registra-
  4240.           tion payment of $10 to Ronald Q. Smith.  The $10 registration fee
  4241.           will license  one copy  for use  on any one  computer at  any one
  4242.           time.  For a registration fee of $25, I will immediately send you
  4243.           the  latest version of CLOCK  including the source  code and this
  4244.           document as a WordPerfect 5.1 file.  You may  use the source code
  4245.  
  4246.           for your own maintenance of  CLOCK or as a learning tool  for any
  4247.           software  that you develop.  You  may not use all  or part of the
  4248.           source code in any software that you develop or release to others
  4249.           without the permission of Ronald Q. Smith.
  4250.  
  4251.           You must  treat this software  just like a  book.  An  example is
  4252.  
  4253.           that this software may be used by any number of people and may be
  4254.           freely moved  from one computer  location to another,  so long as
  4255.           there is  no possibility of  it being used at  one location while
  4256.           it's being used at another.  Just as a book cannot be read by two
  4257.           different persons at the same time.
  4258.  
  4259.  
  4260.           Commercial users of  CLOCK must register and pay for their copies
  4261.           of CLOCK within  30 days of first  use or their license  is with-
  4262.           drawn.   Site-License  arrangements  may be  made  by  contacting
  4263.           Ronald Q. Smith.
  4264.  
  4265.           Anyone distributing CLOCK for any kind of remuneration must first
  4266.  
  4267.           contact Ronald Q. Smith at the address below for authorization.
  4268.  
  4269.           You are encouraged to pass a  copy of CLOCK along to your friends
  4270.           for evaluation.  Please encourage them to register their copy  if
  4271.           they  find  that they  can use  it.   All  registered  users will
  4272.           receive a copy of the latest version of the CLOCK system.
  4273.  
  4274.  
  4275.           Send the fees and any inquiries to:
  4276.  
  4277.                          Ronald Q. Smith
  4278.                          11 Black Oak Road
  4279.                          North Oaks, MN 55127-6204
  4280.  
  4281.  
  4282.           You may also contact me via CompuServe mail at userid  71620,514.
  4283.           I will  be happy to respond  to any problems  and suggestions for
  4284.           future capabilities.
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.           CLOCK Version 3.52                              November 19, 1993
  4299.  
  4300.  
  4301.           You may register CLOCK through the CompuServe Shareware Registra-
  4302.           tion program.  CLOCK.SYS is found under registration ID 104.  The
  4303.           fee  for registering  through CompuServe  is $12 (to  cover their
  4304.  
  4305.           charge) and will be added directly to your CompuServe bill.
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.           CLOCK Version 3.52                              November 19, 1993
  4365.  
  4366.  
  4367.           APPENDIX B:  CLOCK TYPES
  4368.  
  4369.  
  4370.  
  4371.           B.1  Type 0 - PC/AT
  4372.  
  4373.           IBM PC/AT and  all fully compatible  PCs.   Most versions of  DOS
  4374.           fully support  this clock  interface without  a separate  driver.
  4375.           Use CLOCK.SYS to provide support for CLK.EXE and CLKDEMO.EXE.  If
  4376.           you don't  need the  extra functions of  CLK, you  probably don't
  4377.  
  4378.           need CLOCK.SYS.  However,  there were a couple  of late 8088  PCs
  4379.           that adopted  the PC/AT  clock standard but  did not  provide the
  4380.           PC/AT recognition  sentinel.  DOS  will not  find the clock,  but
  4381.           CLOCK.SYS will.
  4382.  
  4383.           Amstrad PC1521DD systems use this type of clock.
  4384.  
  4385.                           
  4386.           Automatic  determination checks  location  F000:FFFE for  the hex
  4387.           value FC.
  4388.  
  4389.           BIOS calls are used  to read and write the clock values which are
  4390.           usually  stored in  the CMOS  RAM along with  other configuration
  4391.  
  4392.           information.  The primary interfaces are:
  4393.                           
  4394.                Get Date: MOV  AH,4
  4395.                          INT  1AH
  4396.                               Returns the year in  CX and month and  day in
  4397.                               DX in BCD  format (e.g., a hex  display would
  4398.  
  4399.                               show:  CX=1991, DX=1009 for October 9, 1991).
  4400.  
  4401.                Set Date: MOV  AH,5
  4402.                               Load CX and DX as above for Get Date
  4403.                          INT  1AH
  4404.  
  4405.  
  4406.                Get Time: MOV  AH,2
  4407.                          INT  1AH
  4408.                               Returns hours  and minutes in CX  and seconds
  4409.                               in DH in BCD format.   May also return 100ths
  4410.                               of seconds in DL (e.g., CX=2359, DX=5900  for
  4411.                               1 second before midnight).
  4412.  
  4413.  
  4414.                Set Time: MOV  AH,3
  4415.                               Load CX and DX as for Get Time
  4416.                          INT  1AH
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.           CLOCK Version 3.52                              November 19, 1993
  4431.  
  4432.  
  4433.  
  4434.  
  4435.           B.2  Type 1 - Zenith Z-18x portables, Supersport 20
  4436.  
  4437.  
  4438.           Automatic determination  checks location  F000:FFFA for  the two-
  4439.           byte hex value 4D32 ("M2").
  4440.  
  4441.           BIOS calls are used to read and write the clock.
  4442.  
  4443.  
  4444.                Get Date: MOV  AH,2
  4445.                          INT  1AH
  4446.                               Returns CX=year  (1980 - 2079) in  binary and
  4447.                               DH=month, DL=day.  All values are binary.   A
  4448.                               hex display of the above date would look like
  4449.                               CX=7C7, DX=A09.
  4450.  
  4451.  
  4452.                Set Date: MOV  AH,3
  4453.                               Load CX and DX as for Get Date.
  4454.                          INT  1AH
  4455.  
  4456.                Get Time: MOV  AH,4
  4457.  
  4458.                          INT  1AH
  4459.                               Returns CH=hours, CL=minutes, DH=seconds.   A
  4460.                               hex display would show: CX=173B, DX=3B00.
  4461.  
  4462.                Set Time: MOV  AH,5
  4463.                               Load CX and DX as for Get Time.
  4464.  
  4465.                          INT  1AH
  4466.  
  4467.  
  4468.           B.3  Type 2 - Various Zenith Data System PCs.
  4469.  
  4470.           Automatic  determination  looks  at location  F000:800A  for  the
  4471.  
  4472.           pattern 00,F0,"ZDS".
  4473.  
  4474.                Get Date: MOV  AH,2AH
  4475.                          INT  1AH
  4476.                               Returns CX and DX as for type 1.
  4477.  
  4478.  
  4479.                Set Date: MOV  AH,2BH
  4480.                               Load CX and DX as for type 1.
  4481.                          INT  1AH
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.           CLOCK Version 3.52                              November 19, 1993
  4497.  
  4498.  
  4499.                Get Time: MOV  AH,2CH
  4500.                          INT  1AH
  4501.                               Returns CX and DX as for type 1.
  4502.  
  4503.  
  4504.                Set Time: MOV  AH,2DH
  4505.                               Load CX and DX as for type 1.
  4506.                          INT  1AH
  4507.  
  4508.  
  4509.  
  4510.           B.4  Type 3 - Memory-Mapped Clocks
  4511.  
  4512.           Memory-mapped clock  used on  some Zenith  Data  Systems PCs  and
  4513.           other similar clocks including many slot-less or  no-slot clocks.
  4514.           The SMT  (Systems Manufacturing  Technology)  No-Slot clocks  are
  4515.           supported by this type.
  4516.  
  4517.  
  4518.           Automatic determination  is to  attempt to  read the  clock.   If
  4519.           values other than all 0FFH or  0 are obtained, this clock type is
  4520.           chosen.  All known segments and offsets are tried.
  4521.  
  4522.           Several different  memory mapping  approaches are  used and  many
  4523.  
  4524.           different address  possibilities are  supported.   In  general  a
  4525.           segment address in the ROM region  (C800H through FFFFH) is used.
  4526.           Offsets from that  segment address are  used to read  bits, write
  4527.           zero bits, and write one  bits.  Documentation may specify  those
  4528.           segments and addresses  in several forms.   For example,  segment
  4529.           F000 with offset F002 is the same as segment FF00 with offset 2.
  4530.  
  4531.  
  4532.           Each memory reference reads or writes a single bit.   Read opera-
  4533.           tions  are used  for  all references  with  separate offsets  for
  4534.           reading a bit, writing a zero bit, and writing a one bit.
  4535.  
  4536.           Clock segments and addresses currently probed include:
  4537.  
  4538.  
  4539.               ╔═══════╤═════════╤════════╤═════╤═════╤═════╤════════╗
  4540.               ║SEGMENT│WRITE 0  │WRITE 1 │READ │DECR │LAST │VENDOR  ║
  4541.               ╟───────┼─────────┼────────┼─────┼─────┼─────┼────────╢
  4542.               ║F000   │ F002    │F003    │F004 │0000 │F000 │(Zenith)║
  4543.               ╟───────┼─────────┼────────┼─────┼─────┼─────┼────────╢
  4544.  
  4545.               ║FE00   │    2    │   3    │   5 │0080 │C800 │SMT     ║
  4546.               ╟───────┼─────────┼────────┼─────┼─────┼─────┼────────╢
  4547.               ║FE00   │    0    │   2    │   8 │0080 │C800 │SMT     ║
  4548.               ╚═══════╧═════════╧════════╧═════╧═════╧═════╧════════╝
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.           CLOCK Version 3.52                              November 19, 1993
  4563.  
  4564.  
  4565.           Multiple address  combinations may be  tried for each  clock pat-
  4566.           tern.  The  DECR value is  subtracted from the SEGMENT  value for
  4567.           another attempt at  probing until  the value equals  LAST.   Note
  4568.  
  4569.           that  like the  SEGMENT address,  DECR and  LAST are in  units of
  4570.           paragraphs (16-bytes).  Thus DECR of  80 is equivalent to 800H or
  4571.           2048 bytes.
  4572.  
  4573.           When the addresses used  by a memory-mapped clock  are determined
  4574.           by probing,  the segment and read  address is displayed.   As the
  4575.  
  4576.           read  address varies  the  most from  one  clock manufacturer  to
  4577.           another it is a good indication of the type of clock found.
  4578.  
  4579.           Data is stored in BCD in  bytes that you construct by shifting in
  4580.           the bits.  The most important data bytes are: 
  4581.                0 = Hundredths of seconds
  4582.  
  4583.                1 = Seconds
  4584.                2 = Minutes
  4585.                3 = hours
  4586.                5 = days
  4587.                6 = months
  4588.                7 = years mod 1980
  4589.  
  4590.  
  4591.  
  4592.           B.5  Type 4 - Direct Register I/O Bus Clock
  4593.  
  4594.           Many add-in  clocks on expansion  boards use this type  of clock.
  4595.           Some built-in  clocks in PCs  are also accessed  similarly.  This
  4596.  
  4597.           clock was used on many AST Research I/O  boards for 8088 PCs such
  4598.           as  the Six-Pack Plus,  IO Plus,  etc.  Also  used on  some Tandy
  4599.           systems (e.g., 1200HD) and the Vendex Turbo-888-XT.
  4600.  
  4601.           Automatic determination is to attempt to read, complement, write,
  4602.           re-read, and re-complement  one of the  registers.  If the  first
  4603.  
  4604.           value  read and the  re-complemented second value  are equal, the
  4605.           register exists and is presumed to be the clock.
  4606.  
  4607.           See also the description for types 6  and 7.  If you aren't  sure
  4608.           which variant you have, specify type 8 and automatic probing will
  4609.           determine if it  is really a type 4,  6, or 7.   For the greatest
  4610.  
  4611.           chance of detecting the correct  clock type, supply the base  I/O
  4612.           address if at all possible.
  4613.  
  4614.           NOTE:  If the  clock is not correctly initialized (e.g., you have
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.           CLOCK Version 3.52                              November 19, 1993
  4629.  
  4630.  
  4631.           just replaced the battery), CLOCK.SYS  must initialize it so that
  4632.           the  counters will start working.   CLOCK.SYS determines that the
  4633.           clock has  been previously initialized by looking at register 14H
  4634.  
  4635.           (see B below).  If register B contains  the value 0DEH, the clock
  4636.           is presumed to be initialized.   If not, CLOCK.SYS will clear all
  4637.           the registers to zero and start the counters running.  While this
  4638.           form  of  checking  for initialization  was  commonly  used, your
  4639.           previous software may  have used a different method.   If so, the
  4640.           first time  you run CLOCK.SYS  your date and  time may be  set to
  4641.  
  4642.           zero (1980-1-1 00:00:00).  If  that happens, just enter the  date
  4643.           and time.  It should work OK after that without resetting to zero
  4644.           on further boots.
  4645.  
  4646.           Each clock register is implemented as a separate I/O register ad-
  4647.           dress.  Clock  base I/O addresses of  240H, 2C0H, 300H,  and 340H
  4648.  
  4649.           are supported by automatic probing.  Similar clocks at other base
  4650.           I/O addresses  are supported by  specifying type  4 and the  base
  4651.           address. The  address range used  is the base plus  0 through 1FH
  4652.           (e.g., 2C0H through 2DFH).
  4653.                           
  4654.           Important registers are (using 2C0 as the example):
  4655.  
  4656.                           
  4657.                2C1  =  100ths of seconds 
  4658.                2C2  =  seconds 
  4659.                2C3  =  minutes 
  4660.                2C4  =  hours 
  4661.                2C6  =  days
  4662.  
  4663.                2C7  =  months
  4664.                2C9  =  month last time clock was read/set 
  4665.                2CA  =  years
  4666.                2CB  =  initialized flag (0DEH if initialized)
  4667.                2D4  =  Status
  4668.                               
  4669.  
  4670.           All values are in BCD.  That means that each register consists of
  4671.           two 4-bit nybbles (a nybble is to a nibble as a byte is to a bite
  4672.           - I haven't seen this used recently, but as a bit  of trivia, the
  4673.           first IBM 360 principles of operation manuals used  that term and
  4674.           that spelling - at least  in a draft copy  that we got in  1965).
  4675.           Each nybble contains one  decimal digit of the value.   Years are
  4676.  
  4677.           mod 1980 (i.e., 0 means 1980, 99 means 2079).
  4678.  
  4679.           Since these  clocks do not keep  the year and do  not handle leap
  4680.           years for you, CLOCK.SYS does the necessary  calculations to keep
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.           CLOCK Version 3.52                              November 19, 1993
  4695.  
  4696.  
  4697.           the year  correctly maintained  and to adjust  the date  for leap
  4698.           days.   The  clocks do provide  a couple  of memory  locations in
  4699.           which CLOCK.SYS maintains the  year and previous month.   As long
  4700.  
  4701.           as you boot  your system before a full year has passed, CLOCK.SYS
  4702.           will correctly maintain the date.
  4703.  
  4704.  
  4705.           B.6  Type 5 - Mitsubishi 8088 PCs
  4706.  
  4707.  
  4708.           These were  sold by Sperry as the PC-1 and PC/HT, by Leading Edge
  4709.           as the Model D, by Mitsubishi, and others.
  4710.  
  4711.           Automatic determination checks location F000:FFB3 for  the string
  4712.           "MITSUBISHI".  Later Mitsubishi PCs which used a different  clock
  4713.           had the same string at a  different location.  We hope all  early
  4714.  
  4715.           versions had it at this location.
  4716.  
  4717.           BIOS functions are used to access the clock.
  4718.  
  4719.                Get Date: MOV  AH,4
  4720.                          INT  1AH
  4721.  
  4722.                               Returns   CL=year  mod  1980,  DH=month,  and
  4723.                               DL=day all in  binary.  Also sets  AL=0FFH if
  4724.                               the clock is busy  and the request should  be
  4725.                               retried.
  4726.  
  4727.                Set Date: MOV  AH,5
  4728.  
  4729.                               Load CL, DX as for Get Date.
  4730.                          INT  1AH
  4731.                               Returns AL=0FFH if busy.
  4732.  
  4733.                Get Time: MOV  AH,2
  4734.                          INT  1AH
  4735.  
  4736.                               Returns  CH=hour,  CL=minute, DH=second,  and
  4737.                               AL=status.  AL=0FFH  means busy.   AL=0 means
  4738.                               24-hour mode.  AL=1  means AM and AL=3  means
  4739.                               PM.
  4740.  
  4741.                Set Time: MOV  AH,3
  4742.  
  4743.                               Load AL, CX, DH as for Get Time.
  4744.                          INT  1AH
  4745.                               Returns AL=0FFH if busy.
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.           CLOCK Version 3.52                              November 19, 1993
  4761.  
  4762.  
  4763.           NOTE:  Some early Mitsubishi PCs came with fixed disk controllers
  4764.           that were not DOS compatible.  In addition to the clock modifica-
  4765.           tions, the DOS for those systems also handled the disk controller
  4766.  
  4767.           variant.  If you have  such a PC, CLOCK.SYS is not  sufficient to
  4768.           enable you to  go above DOS  level 3.2.   You will  also need  to
  4769.           replace your fixed disk controller.   I strongly suggest that you
  4770.           create a boot floppy for your current DOS level before you try to
  4771.           install your new DOS level.  Then boot your new DOS from a floppy
  4772.           disk, do SYS C: and copy COMMAND.COM to C:, then try a disk boot.
  4773.  
  4774.           If the disk boot fails, boot the floppy you just created and do a
  4775.           SYS C: and  copy COMMAND.COM to C:  to restore your old  DOS ver-
  4776.           sion.  At that point, your best bet is to simply give up and stay
  4777.           with DOS 3.2. If you want to proceed, you must replace your fixed
  4778.           disk controller.
  4779.  
  4780.  
  4781.           If SYS  C: gives you  an error  status that indicates  that there
  4782.           isn't room  for the new  DOS version  (very possible when  moving
  4783.           from 3.2 to 3.3 or above), you must backup your entire fixed disk
  4784.           and use  FORMAT C:/S to place the new version of DOS on the disk.
  4785.           While this is a  hassle, at least if your PC won't  boot from the
  4786.           disk, the fall-back approach is identical.  There will be room to
  4787.  
  4788.           put DOS 3.2 or earlier back on the fixed disk.
  4789.  
  4790.  
  4791.           B.7  Type 6 - Indirect Register I/O Bus Clock
  4792.  
  4793.           Used on AST Research boards and  others.  Typically uses the same
  4794.  
  4795.           I/O base address  as type  4.   However the  clock registers  are
  4796.           selected by sending the register  address to the base I/O address
  4797.           and then  reading or writing  data at the  base I/O address  + 1.
  4798.           The internal register numbers and their contents are the same  as
  4799.           for type 4.
  4800.  
  4801.  
  4802.           Automatic determination by probing the address register.   If the
  4803.           low-order bit is one, it may be this type of clock or type 7.  We
  4804.           then look  further to determine if it  is type 7.   If you aren't
  4805.           sure which type of clock you have but  believe it is type 4, 6 or
  4806.           7, specify type 8 and automatic probing will detect which variant
  4807.           it is.  If at  all possible specify the base I/O  address as that
  4808.  
  4809.           will increase  the likelihood that  the correct determination  is
  4810.           made.
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.           CLOCK Version 3.52                              November 19, 1993
  4827.  
  4828.  
  4829.           I/O  addresses used  are (again  using  2C0 as  the example  base
  4830.           address):
  4831.  
  4832.  
  4833.                2C0    =  Address register.  Writing a value to this address
  4834.                          selects the internal register to read or write.
  4835.                2C1    =  Data  register.  Reading  or writing this address,
  4836.                          reads or  writes the internal  register previously
  4837.                          selected by writing 2C0.
  4838.  
  4839.  
  4840.           The internal register numbers are (the values to write to 2C0):
  4841.  
  4842.                 1  =  100ths of seconds
  4843.                 2  =  seconds
  4844.                 3  =  minutes
  4845.                 4  =  hours
  4846.  
  4847.                 6  =  days
  4848.                 7  =  months
  4849.                 9  =  month last time date was read or written
  4850.                 A  =  year
  4851.                 B  =  initialization flag
  4852.                14  =  status
  4853.  
  4854.                           
  4855.           Other processing is the same as type 4.
  4856.  
  4857.  
  4858.           B.8  Type 7 - Complex I/O Bus Clock
  4859.  
  4860.  
  4861.           Used on AST Research boards and others.   Typically uses the same
  4862.           base I/O address  as types 4 and  6.  Type 7 uses  a more complex
  4863.           register access sequence than type 6.   Type 7 can be detected by
  4864.           looking to see if the value in register D has bit 1 (value=2) set
  4865.           which type  6 will not.   If you aren't sure which  type of clock
  4866.           you have  but believe it is  type 4, 6  or 7, specify type  8 and
  4867.  
  4868.           automatic  probing will detect  which variant it  is.   If at all
  4869.           possible specify the base I/O  address as that will increase  the
  4870.           likelihood that the correct determination is made.
  4871.  
  4872.           The base I/O address is used as an address register  and the base
  4873.           + 1  as a data register.   This is the same as  for clock type 6.
  4874.  
  4875.           However, the internal registers and  the form of the commands  is
  4876.           quite  different.   The primary difference  is that  the internal
  4877.           registers only hold four bits  of data each.  Thus  each internal
  4878.           register represents a single decimal digit.
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.           CLOCK Version 3.52                              November 19, 1993
  4893.  
  4894.  
  4895.           The I/O addresses are used as follows (using 2C0 as an example):
  4896.  
  4897.                2C0     = Address register.  The number  of an internal reg-
  4898.  
  4899.                          ister plus 80H  is written to this I/O  address to
  4900.                          select an internal register.
  4901.  
  4902.                2C1     = Data register.    Four bits  of data  are read  or
  4903.                          written  using  this I/O  address from  or  to the
  4904.                          internal register  previously selected  by writing
  4905.  
  4906.                          to 2C0.
  4907.  
  4908.           The internal registers are:
  4909.  
  4910.                0  =  Units digit of seconds
  4911.                1  =  Tens digit of seconds
  4912.  
  4913.                2  =  Units digit of minutes
  4914.                3  =  Tens digit of minutes
  4915.                4  =  Units digit of hours
  4916.                5  =  Tens digit of hours
  4917.                6  =  Day of week
  4918.                7  =  Units digit of day of month
  4919.  
  4920.                8  =  Tens digit of day of month
  4921.                9  =  Units digit of month
  4922.                A  =  Tens digit of month
  4923.                B  =  Units digit of year
  4924.                C  =  Tens digit of year
  4925.                D  =  Function register
  4926.  
  4927.                E  =  Function register
  4928.                F  =  Function register
  4929.  
  4930.  
  4931.           B.9  Type 8 - Generic I/O Bus Clock
  4932.  
  4933.  
  4934.           Type unknown.  Probe only for types 4,  6, 7, 9, and B.  Use type
  4935.           8 if you are sure that you have an I/O bus clock (i.e., the clock
  4936.           is on an add-in card) but aren't sure whether it is type 4, 6, 7,
  4937.           9, or B.  If at all possible,  supply the base I/O address of the
  4938.           clock as this will greatly increase the likelihood of the correct
  4939.           handling method being chosen.
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.           CLOCK Version 3.52                              November 19, 1993
  4959.  
  4960.  
  4961.           B.10 Type 9 - Quadram I/O Bus Clock
  4962.  
  4963.           This  type  was  used by  Quadram  Corporation  on  the QuadCard,
  4964.  
  4965.           QuadCard II, and QuadCard 512+.  It may  have been used on others
  4966.           as well.
  4967.  
  4968.           Automatic determination checks to see that I/O registers exist at
  4969.           310H or 210H.
  4970.  
  4971.  
  4972.           This clock  used four I/O  control registers and  twelve internal
  4973.           registers.  The I/O registers (using 310H as the example) are:
  4974.  
  4975.                310  =  Data register (used to move data values)
  4976.                311  =  Address register (used to select internal register)
  4977.                312  =  Function register (Read, write, hold counter)
  4978.  
  4979.                313  =  Control register (Enables read or write function)
  4980.  
  4981.           The internal registers are:
  4982.  
  4983.                 0 = Units digit of seconds
  4984.                 1 = Tens digit of seconds
  4985.  
  4986.                 2 = Units digit of minutes
  4987.                 3 = Tens digit of minutes
  4988.                 4 = Units digit of hours
  4989.                 5 = Tens  digit of hours - Also uses bit 2 (=4) to indicate
  4990.                     PM if in  12-hour mode and bit 3 (=8) to select 24-hour
  4991.                     mode
  4992.  
  4993.                 6 = Day of week (we don't use this)
  4994.                 7 = Units digit of days
  4995.                 8 = Tens digit of  days - Also uses bit  3 (=8) to indicate
  4996.                     that this  is a  leap year.   This bit  must be  set by
  4997.                     software whenever there is less than 366 days until the
  4998.                     next leap day.  If you  do not boot within that period,
  4999.  
  5000.                     leap day will not be taken.
  5001.                 9 = Units digit of months
  5002.                10 = Tens digit of months
  5003.                11 = Units digit of year mod 1900 or 2000
  5004.                12 = Tens digit of year mod 1900 or 2000
  5005.  
  5006.  
  5007.           NOTE:  If you have this type  of clock, you can only set the time
  5008.           to  the minute.  Whenever the time is set, the seconds are always
  5009.           set to zero.  You should set the time as the minute changes.  For
  5010.           that reason, you  will not want  to use the automatic  adjustment
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.           CLOCK Version 3.52                              November 19, 1993
  5025.  
  5026.  
  5027.           capability of CLK with  this type of clock as it  will try to set
  5028.           the time to the nearest second.
  5029.  
  5030.  
  5031.  
  5032.           B.11 Type A - AT&T 6300, 6300 PLUS, 6300 WGS
  5033.  
  5034.           Automatic  probing is accomplished  by trying to  read the clock.
  5035.           If the read attempt using the BIOS is successful (carry flag  not
  5036.           set) and the values returned look like a valid time, the clock is
  5037.  
  5038.           assumed to be present.
  5039.  
  5040.           NOTE:  AT&T clocks  do not advance the year on January  1.  It is
  5041.           necessary  to  change the  date at  the  beginning of  each year.
  5042.           Also,  AT&T clocks always clear the seconds to zero when the time
  5043.           is changed.  For this reason  you should always set the date  and
  5044.  
  5045.           time at  the beginning of a minute.   You should also not use the
  5046.           automatic adjustment feature of CLK with these clocks.
  5047.  
  5048.           A base year may be specified on the DEVICE= line.  If it is  not,
  5049.           1992 will be  used.  This  base will be  good for all  dates from
  5050.           1992-1-1 till 1999-12-31.
  5051.  
  5052.  
  5053.           BIOS functions are used with this clock.
  5054.  
  5055.                Get Date: MOV  AH,0FEH
  5056.                          INT  1AH
  5057.                               Returns BX = Days since  base, CH = Hours, CL
  5058.  
  5059.                               = Minutes, DH = Seconds,  DL = 100ths of sec-
  5060.                               onds
  5061.  
  5062.                Set Date: MOV  AH,0FFH
  5063.                          MOV  BX,Days since base
  5064.                          MOV  CH,Hours
  5065.  
  5066.                          MOV  CL,Minutes
  5067.                          MOV  DH,0
  5068.                          MOV  DL,0
  5069.                          INT  1AH
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.           CLOCK Version 3.52                              November 19, 1993
  5091.  
  5092.  
  5093.           B.12 Type B - Hyundai 8088 Clock
  5094.  
  5095.           Automatic determination probes  the control registers.   If they,
  5096.  
  5097.           appear to be present, CLOCK tries to read  the clock.  Legal time
  5098.           and date values will select this clock.
  5099.  
  5100.           This clock uses I/O addresses E0H through EFH as follows:
  5101.                E0  =  Units digit of seconds
  5102.                E1  =  Tens digit of seconds
  5103.  
  5104.                E2  =  Units digit of minutes
  5105.                E3  =  Tens digit of minutes
  5106.                E4  =  Units digit of hours
  5107.                E5  =  Tens digit of hours
  5108.                E6  =  Day of week
  5109.                E7  =  Units digit of days
  5110.  
  5111.                E8  =  Tens digit of days
  5112.                E9  =  Units digit of month
  5113.                EA  =  Tens digit of month
  5114.                EB  =  Units digit of year
  5115.                EC  =  Tens digit of year
  5116.                ED  =  Control
  5117.  
  5118.                EE  =  Control
  5119.                EF  =  Control
  5120.  
  5121.           B.13 Type C - Multi I/O Card Clock
  5122.  
  5123.           This clock is  an I/O clock that  appears at address 338H  in the
  5124.  
  5125.           one case we have  found it.  It is similar  to, but not identical
  5126.           to, the Quadram clock in its operation pattern.  The manufacturer
  5127.           is not known, but  the clock appears  on a board manufactured  in
  5128.           Taiwan and with a label of Multi I/O Card.   This card has a game
  5129.           port, floppy controller, printer, clock, etc.
  5130.  
  5131.  
  5132.           Probing tries to read the clock and compare  the values for legal
  5133.           ranges.
  5134.  
  5135.           It uses three  I/O registers.  These are 338H,  339H, and 33AH in
  5136.           the one  example found.   Register 338H  is a selection  and mode
  5137.           register used to set read and write modes and select the internal
  5138.  
  5139.           register.   It  is also  read to  read the  value in  an internal
  5140.           register.  Register 339H is written to set a value in an internal
  5141.           register.  Register 33AH is apparently a control register that is
  5142.           used to start and stop the clock updates.
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.           CLOCK Version 3.52                              November 19, 1993
  5157.  
  5158.  
  5159.           The internal registers are:
  5160.  
  5161.                 0 = Units digit of seconds
  5162.  
  5163.                 1 = Tens digit of seconds
  5164.                 2 = Units digit of minutes
  5165.                 3 = Tens digit of minutes
  5166.                 4 = Units digit of hours
  5167.                 5 = Tens digit of hours - Also uses bit 2 (=4) to  indicate
  5168.                     PM if  in 12-hour mode and bit 3 (=8) to select 24-hour
  5169.  
  5170.                     mode
  5171.                 6 = Day of week
  5172.                 7 = Units digit of days
  5173.                 8 = Tens digit  of days - Also uses  bit 3 (=8) to indicate
  5174.                     that  this is  a leap year.   This  bit must  be set by
  5175.                     software whenever there is less than 366 days until the
  5176.  
  5177.                     next leap day.  If you  do not boot within that period,
  5178.                     leap day will not be taken.
  5179.                 9 = Units digit of months
  5180.                10 = Tens digit of months
  5181.                11 = Units digit of year mod 1900 or 2000
  5182.                12 = Tens digit of year mod 1900 or 2000
  5183.  
  5184.  
  5185.  
  5186.  
  5187.  
  5188.  
  5189.  
  5190.  
  5191.  
  5192.  
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202.  
  5203.  
  5204.  
  5205.  
  5206.  
  5207.  
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.           CLOCK Version 3.52                              November 19, 1993
  5223.  
  5224.  
  5225.           APPENDIX C:  REVISION HISTORY
  5226.  
  5227.           931119 -  Version 3.52: Fix bug  when 5th day occurs on  last day
  5228.  
  5229.                     of month  so we don't change the  time season too soon.
  5230.                     Fix bug  in displaying correct clock type  when type is
  5231.                     specified on DEVICE= line in CONFIG.SYS.  Change  prob-
  5232.                     ing  for type 4  clocks to increase  likelihood that we
  5233.                     will find them  even if they  aren't initialized.   Fix
  5234.                     bug in continuous display that  can cause it to display
  5235.  
  5236.                     digits in reverse order.
  5237.  
  5238.           930909 -  Version 3.51:  Allow Quadram clocks  to be set  even if
  5239.                     seconds are non-zero.  Ignore seconds.
  5240.  
  5241.           930720 -  Version 3.50:  Improve documentation by  explaining the
  5242.  
  5243.                     two types of clocks in  the introduction.  Also put the
  5244.                     Windows note  in a  separate section  so it  is in  the
  5245.                     table of contents and easier to find.
  5246.  
  5247.           930707 -  Version 3.49: Fix writing to clock type C.
  5248.  
  5249.  
  5250.           930701 -  Version 3.48: Add  clock type C.  Fix searching for AST
  5251.                     clock I/O addresses.   A bug crept in at  about version
  5252.                     3.40 that could cause addresses to be missed.
  5253.  
  5254.           930410 -  Version 3.47: Add MET time zone  to list of pre-defined
  5255.                     time zones (GMT-1).  Document use of D=  to resume last
  5256.  
  5257.                     display.  Fix  exit on TZ=:?.   Add documentation about
  5258.                     modifying SYSTEM.INI when using TZ= in conjunction with
  5259.                     WINDOWS.
  5260.  
  5261.           930403 -  Version 3.46:  Fix time of switch to  daylight or stan-
  5262.                     dard.  It  was based on GMT and should  have been based
  5263.  
  5264.                     on local time.
  5265.  
  5266.           930311 -  Version 3.45: Correct M= adjustment for  the pending A=
  5267.                     adjustment.
  5268.  
  5269.           930309 -  Version 3.44: Modified M= to automatically set the date
  5270.  
  5271.                     and time on the L= to the same as the last M= if the L=
  5272.                     is earlier.   It also sets any  remaining adjustment to
  5273.                     zero.   This is because the  clock was adjusted exactly
  5274.                     at the point represented by the M=.
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.  
  5288.           CLOCK Version 3.52                              November 19, 1993
  5289.  
  5290.  
  5291.           930306 -  Version 3.43: Fixed bug with  M= function not forcing a
  5292.                     read  of the A= functions in  CLK.INI and thus not cor-
  5293.                     rectly displaying the previous and new adjustment.
  5294.  
  5295.  
  5296.           930304 -  Version 3.42:  Changed time  moving backwards  logic to
  5297.                     only look  for earlier  hours.  At  least one  case has
  5298.                     been seen of a program that set the time backward a few
  5299.                     ticks  by  direct calls  on  the BIOS  and  resulted in
  5300.                     CLOCK.SYS advanceing the day.   Now we only advance the
  5301.  
  5302.                     day if the time  moves backwards an hour or more.  Also
  5303.                     added  the /N option for  CLOCK.SYS that shuts off this
  5304.                     logic  completely if  the  date advances  unexpectedly.
  5305.                     Also fixed a bug in locating  the CLK.INI file when the
  5306.                     A= function is used by itself.
  5307.  
  5308.  
  5309.           930220 -  Version 3.41: Changed timing window prevention logic in
  5310.                     CLOCK.SYS to  control another possible case  of the day
  5311.                     advancing twice over midnight.
  5312.  
  5313.           930212 -  Version 3.40: Added  the M= function  and /M option  to
  5314.                     provide  calculation of  the adjmustment value.   Added
  5315.  
  5316.                     help for all functions and options. Added the /B option
  5317.                     in anticipation of  later support of full-screen  mode.
  5318.                     Added the ,C  flag on the  /I and /M  options to  allow
  5319.                     updating a  read-only file.   Added error  messages for
  5320.                     I/O errors when updating the file.  Fixed timing window
  5321.                     in  CLOCK.SYS  that  could  occur  when the  continuous
  5322.  
  5323.                     display  is operational  that could  cause the  date to
  5324.                     advance unpredictably.
  5325.  
  5326.           930204 -  Version  3.31: Fixed bug  in CLOCK.SYS with  some clock
  5327.                     types causing  system lockups  or  bad data  to be  re-
  5328.                     turned.
  5329.  
  5330.  
  5331.           930130 -  Version  3.30:  Added support  for  a password  and for
  5332.                     saving the  current CLOCK.SYS  state as  a new  copy of
  5333.                     CLOCK.SYS for future  booting.   Added continuous  time
  5334.                     display.   Changed API  to  support direct  calls  from
  5335.                     BASIC,  FORTRAN, and  Pascal  as well  as  C and  MASM.
  5336.  
  5337.                     Changed status display to be easier to read.
  5338.  
  5339.           930115 -  Version 3.24: Converted document to WordPerfect 5.1 and
  5340.                     rewrote  much  of  it.   Provide  document  in standard
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.  
  5354.           CLOCK Version 3.52                              November 19, 1993
  5355.  
  5356.  
  5357.                     release that can either be viewed on-line or printed.
  5358.  
  5359.           930110 -  Version 3.23:  Added support  for R=  and W=  commands.
  5360.  
  5361.                     Fixed handling of CLK.INI file so that we don't  try to
  5362.                     update  it if  it is  read only  or is  in a  read-only
  5363.                     sub-directory.   We also don't  update it  if we  can't
  5364.                     find the  [clk]  section as  it may  be someone  else's
  5365.                     file.
  5366.  
  5367.  
  5368.           930106 -  Version 3.22:  Fixed bug in  CLK.EXE that caused  it to
  5369.                     move the CLK.INI file to the root directory.
  5370.  
  5371.           930104 -  Version 3.21: Fixed bug in CLOCK.SYS expecting zero for
  5372.                     100ths of seconds from CMOS clock but some BIOSs  don't
  5373.                     zero the register.  Fixed bug in CLK  with synchroniza-
  5374.  
  5375.                     tion algorithm not correctly waiting for a new second.
  5376.  
  5377.           930102 -  Version 3.20:  Add support for a command file, automat-
  5378.                     ic adjustment, and improved synchronization.  My thanks
  5379.                     to Eric Smith for the ideas that lead to these enhance-
  5380.                     ments.
  5381.  
  5382.  
  5383.           921230 -  Version 3.11:  Simplified logic in CLOCK.SYS for check-
  5384.                     ing if calendar clock should be read.
  5385.  
  5386.           921229 -  Version  3.10: Add support for constant synchronization
  5387.                     with calendar clock.  Fix bug in calculating dates near
  5388.  
  5389.                     the end of leap years.
  5390.  
  5391.           921226 -  Version 3.02: Recompile CLK.EXE and CLKDEMO.EXE to only
  5392.                     use 8088 instructions.  Version 3.01 inadvertently com-
  5393.                     piled with  80286 instructions which  can lock up  8088
  5394.                     systems.
  5395.  
  5396.  
  5397.           921221 -  Version  3.01:  Fixed a  couple  of bugs  in  beta test
  5398.                     version 3.00 with non-PC/AT clocks.  Added logic to CLK
  5399.                     to  display the  pre-defined  time zones  on  errors or
  5400.                     request.
  5401.  
  5402.  
  5403.           921219 -  Version 3.00: Added support for automatic time zone and
  5404.                     daylight  savings time adjustment.   CLOCK.SYS  now has
  5405.                     the  ability to manage the DOS  real time clock and the
  5406.                     battery-protected clock separately.  CLK.EXE is used to
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.  
  5420.           CLOCK Version 3.52                              November 19, 1993
  5421.  
  5422.  
  5423.                     convert a base value  in the battery-protected clock to
  5424.                     a correct local time in the DOS clock.
  5425.  
  5426.  
  5427.           920614 -  Version 2.24: Fixed bug in probing of AT&T 6300 clocks.
  5428.                     Some of the clocks do  not set AL on successful  opera-
  5429.                     tion.
  5430.  
  5431.           920604 -  Version  2.23:  Fixed  bug causing  fall  through  into
  5432.                     memory probing when only I/O probing was wanted.
  5433.  
  5434.  
  5435.           920411 -  Version 2.22: Changed order of probing to probe memory-
  5436.                     mapped clocks last as  they are being spuriously  found
  5437.                     on some Tandy systems.
  5438.  
  5439.           920401 -  Version 2.21:   Changed pattern of I/O  address probing
  5440.  
  5441.                     to probe all possible I/O addresses for one type (e.g.,
  5442.                     4) before  trying any for  another type.   Try to avoid
  5443.                     finding the wrong type.  Added the type B  clock to the
  5444.                     type 8 probe.
  5445.  
  5446.           920328 -  Version 2.20:  Changed order of I/O address probing for
  5447.  
  5448.                     clock types  4,  6, and  7  to avoid,  where  possible,
  5449.                     accessing other boards.   Most commonly used  I/O clock
  5450.                     addresses, I hope, are now probed first.
  5451.  
  5452.           920322 -  Version 2.19:  Improved probing for I/O clocks to check
  5453.                     that legal values are found  in all the data registers.
  5454.  
  5455.                     Several  of the I/O  clocks use  operation sequences so
  5456.                     much like each other that  it is possible to choose the
  5457.                     wrong one if we don't  actually read the time and  date
  5458.                     and see  if the  values are  legal.   This approach  to
  5459.                     probing may possibly result in not finding a clock that
  5460.                     is present but  that has  been totally reset.   Such  a
  5461.  
  5462.                     clock  should be  found on  a second  try to  boot with
  5463.                     CLOCK.SYS as the counters will have advanced by then.
  5464.  
  5465.           920320 -  Version 2.18:   Added  probing for  generic PC/AT  type
  5466.                     clock on systems that don't have the PC/AT signature in
  5467.                     the BIOS.
  5468.  
  5469.  
  5470.           920307 -  Version 2.17:  Added Hyundai 8088 clock.
  5471.  
  5472.           920112 -  Version 2.16:  Added AT&T 6300 clock.
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.  
  5486.           CLOCK Version 3.52                              November 19, 1993
  5487.  
  5488.  
  5489.           920111 -  Version 2.15:  Fixed memory address used by one type of
  5490.                     SMT No-Slot clock.
  5491.  
  5492.  
  5493.           920105 -  Version 2.14:   Added  support for a  wider variety  of
  5494.                     memory mapped  clocks including the SMT  (Systems Manu-
  5495.                     facturing Technology) No-Slot clocks.
  5496.  
  5497.           911208 -  Version 2.13:   Add probing for Vendex Headstart Turbo-
  5498.                     888-XT system and any other  I/O clock at 300H.  Change
  5499.  
  5500.                     I/O clock probing logic to make it  less likely to find
  5501.                     the wrong type by accident.
  5502.  
  5503.           911129 -  Version 2.12:  Fix handling of Quadram clocks (type 9).
  5504.                     They can only set seconds to zero so generate  an error
  5505.                     if anyone tries to set the seconds to any other value.
  5506.  
  5507.  
  5508.           911128 -  Version  2.11:    Fix bug  in  handling  clock type  9,
  5509.                     Quadram clocks that left  clock turned off after opera-
  5510.                     tions.   Also fix bug  in busy determination  for clock
  5511.                     types 4  and 6 that could result in a decision that the
  5512.                     clock was not operational.
  5513.  
  5514.  
  5515.           911121 -  Version 2.10:  Add clock types 6 ,7 and 9.   Add type 8
  5516.                     to do  specific probing for  the various I/O  bus clock
  5517.                     types.
  5518.  
  5519.           911109 -  Version 2.05:   Fix bug  in leap  day handling for  I/O
  5520.  
  5521.                     clocks.  Fix bug that  caused hung systems when setting
  5522.                     the date or time on Z-18x portables.
  5523.  
  5524.           911026 -  Version  2.04:  Add support for I/O clocks at addresses
  5525.                     240H  and  340H.   Reduce resident  memory  required by
  5526.                     clock driver  to only that required  for specific clock
  5527.  
  5528.                     type.
  5529.  
  5530.           911021 -  Version 2.03:   Change  handling of  new day  flag from
  5531.                     BIOS to accommodate  BIOSs that indicate multiple  days
  5532.                     have passed.
  5533.  
  5534.  
  5535.           911020 -  Version 2.02:  Fix bug in returning  date on clock read
  5536.                     functions.  Added message in automatic determination to
  5537.                     indicate type found.
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.           CLOCK Version 3.52                              November 19, 1993
  5553.  
  5554.  
  5555.           911010  - Version  2.01:     Added  automatic   determination  of
  5556.                     Mitsubishi  8088 PC clocks.   Fixed handler to keep the
  5557.                     BIOS counter  set properly  for programs  that read  it
  5558.  
  5559.                     directly.   Also  returns  a  finer  granularity  value
  5560.                     (100ths of seconds) on reads.
  5561.  
  5562.           911009  - Version 2.00:   Modified clock driver to  support addi-
  5563.                     tional clock types.  Thanks to Eric Smith (no relation)
  5564.                     for help in finding out how the Zenith PC clock worked.
  5565.  
  5566.  
  5567.           911005  - Version 1.20:  Changed prologue and epilogue to conform
  5568.                     to  DOS 5.00 documentation.  Seems  to work OK with DOS
  5569.                     5.0 without the changes,  but we might as well  be con-
  5570.                     sistent to save problems later.
  5571.  
  5572.  
  5573.           910903  - Version 1.10:  Added display  of current date and  time
  5574.                     when initializing.
  5575.  
  5576.           910518  - CLOCK version 1.00.   Initial version developed  at the
  5577.                     request of a friend with  a Sperry PC/HT who wanted  to
  5578.                     move to DOS 4.01.
  5579.  
  5580.  
  5581.           1984    - Write clock  device driver for AST clock  for IBM PC-1.
  5582.                     This serves  as the introduction to what device drivers
  5583.                     and especially the CLOCK$ driver are all about.
  5584.  
  5585.  
  5586.  
  5587.  
  5588.  
  5589.  
  5590.  
  5591.  
  5592.  
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.