DOS, dates, and relativity

1 view
Skip to first unread message

Franc Zabkar

unread,
Oct 18, 2005, 2:07:52 AM10/18/05
to
Recently I was trying to demonstrate that a PC's software clock ticks
about 18 times per second. I have an older socket 7 PC, so the
following was sufficient:

C:\WIN98SE>prompt $t$g<space>

14:24:56.02> for %i in ( 1 2 3 4 5 6 7 8 9 0) do rem

14:28:52.20> rem

14:28:52.20> rem

14:28:52.20> rem

14:28:52.20> rem
^^^^^^^^^ time increments by 0.05 sec
14:28:52.25> rem

14:28:52.25> rem

14:28:52.25> rem

14:28:52.25> rem

14:28:52.25> rem

14:28:52.25> rem

14:28:52.25>

However, thinking that this would not be as easy to reproduce on a
faster machine, I tried using commands with a longer execution time.
This is when I discovered that I could make time run backwards.

14:24:55.03> for %i in ( 1 2 3 4 5 6 7 8 9 0) do date 10-18-05

14:24:56.57> date 10-18-05

14:24:56.51> date 10-18-05

14:24:56.46> date 10-18-05

14:24:56.40> date 10-18-05

14:24:56.35> date 10-18-05

14:24:56.29> date 10-18-05

14:24:56.24> date 10-18-05

14:24:56.18> date 10-18-05

14:24:56.13> date 10-18-05

14:24:56.07> date 10-18-05

14:24:56.02>

In 10 iterations the clock loses 0.55 sec, which amounts to about 18.2
ticks per second. This assumes that the date function resets the PC's
counter/timer chip and decrements the tick count by 1.

The above behaviour was observed in a Win98SE DOS box running on a
socket 7 motherboard and an AMD K6-2/450 CPU.

-- Franc Zabkar

Please remove one 'i' from my address when replying by email.

Ted Davis

unread,
Oct 18, 2005, 9:00:43 AM10/18/05
to
On Tue, 18 Oct 2005 16:07:52 +1000, Franc Zabkar
<fza...@iinternode.on.net> wrote:

>Recently I was trying to demonstrate that a PC's software clock ticks
>about 18 times per second. I have an older socket 7 PC, so the
>following was sufficient:
>

<snip>


>
>However, thinking that this would not be as easy to reproduce on a
>faster machine, I tried using commands with a longer execution time.
>This is when I discovered that I could make time run backwards.
>
>14:24:55.03> for %i in ( 1 2 3 4 5 6 7 8 9 0) do date 10-18-05
>
>14:24:56.57> date 10-18-05
>
>14:24:56.51> date 10-18-05
>
>14:24:56.46> date 10-18-05
>
>14:24:56.40> date 10-18-05
>
>14:24:56.35> date 10-18-05
>
>14:24:56.29> date 10-18-05
>
>14:24:56.24> date 10-18-05
>
>14:24:56.18> date 10-18-05
>
>14:24:56.13> date 10-18-05
>
>14:24:56.07> date 10-18-05
>
>14:24:56.02>
>
>In 10 iterations the clock loses 0.55 sec, which amounts to about 18.2
>ticks per second. This assumes that the date function resets the PC's
>counter/timer chip and decrements the tick count by 1.
>
>The above behaviour was observed in a Win98SE DOS box running on a
>socket 7 motherboard and an AMD K6-2/450 CPU.

I've seen this on an 8086 or 80286 machine - It was so long ago I
don't remember exactly. I think I was working in C or assembly when I
encountered it. It was something that saved the time/date, set them
to something else, executed some code, then restored them in a loop.
I don't remember what the program was about.


--
T.E.D. (tda...@gearbox.maem.umr.edu)
SPAM filter: Messages to this address *must* contain "T.E.D."
somewhere in the body or they will be automatically rejected.

Reply all
Reply to author
Forward
0 new messages