delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/21/23:31:24

Message-ID: <360719E2.1D7899F8@montana.com>
Date: Mon, 21 Sep 1998 21:30:42 -0600
From: bowman <bowman AT montana DOT com>
Reply-To: bowman AT montana DOT com
MIME-Version: 1.0
To: Joern Philipp Meier <spacetime AT gmx DOT net>,
"djgpp AT delorie DOT com" <djgpp AT delorie DOT com>
Subject: Re: rawclock() problem
References: <6u677k$j8e$1 AT public DOT ndh DOT net>


Joern Philipp Meier wrote:
> 
> rawclock() should return an unsigned long containing the number of
> clock ticks since midnight. However, the following code prints nothing
> but single integers apparently ranging from 0 to 9.

what 'rawclock' should do, and what it does are two different things. If
you examine the source, you'll find a static unsigned long 'base'. when
'rawclock' is called, if (base == 0), base is set to 'rv', which is the
return of the peek at the clock value. The function then returns rv -
base.

So, the first invocation will return 0, the number of ticks past 'base',
and subsequent invocations will return the tickcount from the first time
'rawclock' was invoked. 

It looks like you will have to do the _farpeekl(_dos_ds, 0x46c) yourself
if you really want the tick count past midnight.


Use the Source, Luke.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019