UTILITY - ATNUDGE2.ZIP - ATCLOCK.DOC

 
Output of file : ATCLOCK.DOC contained in archive : ATNUDGE2.ZIP


ATCLOCK - Documentation Page 1


ATCLOCK.DOC - Description for program ATCLOCK.COM
This description was last updated 7 Sept. 1988.

This program provides three basic functions for AT computers and
compatibles:

1. The CMOS clock is set to the current DOS clock time and date.

2. Once per day, both the CMOS and DOS clocks can be 'nudged' by
a preset amount. The amount of nudge is scaled up if the computer
is not turned on for several days.

3. The program will adjust both system clocks forward or back one
hour for changes between standard and daylight time, if desired.


To use the program:

Put the program ATCLOCK.COM ( or whatever you rename it to ) in the
directory where you intend to use it. This is necessary because the
program creates a file called 'TODAY.AT' in the directory in which
it resides. Note this is not necessarily the directory from which it
is run.


Set the DOS clock to the correct time and date if needed, using the
DOS TIME and/or DATE commands.

Run the program by typing "ATCLOCK/S" or "ATCLOCK/D" for standard or
daylight time. Standard is used if no "/" command is entered.
(Do not type the quotation marks.)

It's not necessary to use the "/S" or "/D" commands after the program
has been run once. Atclock will note the setting in it's date file.
On the other hand, it won't hurt anything if you enter the same command
each time the program is run.

The program will create it's file when run for the first time. It
will re-write the file (TODAY.AT) any time it is run again on a new
day, or if you change parameters.


To adjust your clock with the 'nudge' feature:

Run the program with the command ATCLOCK /Nxx, where xx is the amount
to adjust the clock each day. This value is in DOS clock tick counts.
There are 18.2 (approx) ticks per second. This value will then be
used to adjust the clock each day until it is reset.

Examples:
Adjust the clock forward by 5 seconds each day: ATCLOCK /N91
Adjust the clock backward by 2 seconds each day: ATCLOCK /N-36








ATCLOCK - Documentation Page 2


To change from daylight to standard time:

Run the program with ATCLOCK /S, after the clock has been set using
daylight time. You will receive a prompt as follows:
"Do you want to set the clock back one hour for standard time?"
Enter Y to make the change, N to leave the clock where it is. In
either case, the new time is recorded as standard.

Changing to daylight is done the same way with the "/D" option.

You can combine the /D or /S commmand with the /N command to set a new
nudge value at the same time. Entering /S when the clock is already on
standard time will have no effect. Note that you can't use this option
until you have run the program at least once so it knows which time you
are using.

AtClock has one more command - The "/1" says to nudge the clock by one
day's nudge value (at most), regardless of the number of days that have
passed since the last time it was run. This is for anyone who has the
older version of the program, which always worked this way.





This program is Copyright T. McGuire. It is entirely my own invention.
The program is free of charge, and no restrictions are placed on it's
use. It is not guaranteed to do anything specific. It also has no
"look and feel" that I can find.

References used were the IBM PC-AT technical reference for the Bios
calls, PC-DOS 3.1 manual for the DOS calls. The program was assembled
with Masm 5.1.

The author can be reached for comments on CompuServe, IBMHW or via
Easyplex, PPN 73210,2531.










Some details:

The program writes the current date in the file TODAY.AT, along with
the specified 'nudge' value. It also writes a D or S after the date
for daylight or standard time. When run, it will read the file and
compare the date to the DOS date to find out if it is a new day. If
it is a new day, the number of days that have passed since the last run
are calculated. If there is a non-zero nudge value, the DOS clock is
adjusted by the amount specified times the number of days passed.
In any case, the CMOS clock is set to the current time of the DOS
clock at the end of the program.



ATCLOCK - Documentation Page 3



The program converts the date from DOS to a Julian date to compare with
the previous date. The Julian date is also saved in the date file,
along with the date in Ascii.

If a "/S" or "/D" command is given, and it doesn't match the value in
the date file, you are prompted for changing the clock by one hour, as
mentioned above.

If the clock is adjusted, a message is displayed to that effect.
The current time and date are always displayed.

The program is intended to be run from an Autoexec file. It will then
keep the CMOS clock adjusted properly if run once per day. Running it
more than once will not cause any further adjustments. If you haven't
turned on your computer in a few days, the adjustment is multiplied.

The program can also be used to set the CMOS clock to the DOS clock
after you have entered the correct time/date to the DOS clock. If you
change between standard and daylight via DOS, or replace your clock
battery, remember to run Atclock after setting the DOS clock. It's
much easier than the Setup program!

The data file TODAY.AT is an Ascii file that can be examined with a
word processor or other utility program, or TYPEd, PRINTed, etc.
The file is of the form:
Tue 01 Mar 1988 S****880306+0018
The last value is the 'nudge' value that was last selected (0 if
none selected). If you forget what you have set, you can examine
the file to find out.

The "S****" represents Standard time, with 4 bytes of binary data for
the year and Julian date.

Deleting the data file will have the same effect as setting the
'nudge' value to zero and the time to standard.

The archive file includes assembly language source code for the main
portion of the program. Some utility functions are performed by
programs in the library file 'Asmutils', which is also included. The
header file 'Asmutils.asi' must be accessible to assemble the program.

If you want to modify the program, it should be linked with the
ASMUTILS library after re-assembling.

The program was assembled with MASM rev. 5.1. It does use some
assembler features that are new with this version. The program
contains some 80286 instructions, so can not run on PCs or XTs.
It also requires DOS 3.0 or later.