delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/15/04:56:40

Date: Sun, 15 Jun 1997 11:54:50 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Steve Higgins <steve AT psp-digital DOT co DOT uk>
cc: "'DJGPP Mail List'" <djgpp AT delorie DOT com>
Subject: Re: Intermittent uclock() failure under DOS.
In-Reply-To: <01BC7742.2B312840@TAURUS>
Message-ID: <Pine.SUN.3.91.970615115406.14561G-100000@is>
MIME-Version: 1.0

On Thu, 12 Jun 1997, Steve Higgins wrote:

> My bodge work around is to call the this function at the start of main().
> 
> void startup_uclock()
> {
>     unsigned long tics;
>     
>     tics = _farpeekl(_dos_ds,0x46c);
>     
>     /* wait for a BIOS tick */
>     while(tics == _farpeekl(_dos_ds,0x46c));
>     /* initialise uclock() */
>     uclock();
> }

I don't understand.  Here's a fragment from `uclock' sources:

  /* Make sure the numbers we get are consistent */
  do {
    otics = _farpeekl(_dos_ds, 0x46c);
    outportb(0x43, 0x00);
    lsb = inportb(0x40);
    msb = inportb(0x40);
    tics = _farpeekl(_dos_ds, 0x46c);
  } while (otics != tics);

It appears that `uclock' *does* in fact attempt to make both parts of
the value consistent.  Can you explain what is it that your loop does
better than this one?  Thanks.

- Raw text -


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