delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/14/09:28:29

Subject: Re: uclock() counts down?
MIME-Version: 1.0
Date: Fri, 14 Feb 2003 09:31:10 -0500
X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0
content-class: urn:content-classes:message
Message-ID: <795DD3C2E97585449DCDEEE79CCD5C22BA8E@email2k.compuweigh.com>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Re: uclock() counts down?
Thread-Index: AcLUNbdXYtRh6d0BREGt8tVqqJb8VQ==
From: "Alex O" <Alex AT compuweigh DOT com>
To: "DJGPP (E-mail)" <djgpp AT delorie DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id h1EES2P10812
Reply-To: djgpp AT delorie DOT com

Vinzent wrote:

>Yes, most probably you are confusing the reading of the 8254 timer chip.
>You only read one byte of a 16-bit value, so the next time someone
>(uclock()) is reading it will get the bytes in reversed order.
>
>Reading both bytes and making sure, interrupts are disabled during that
>time should do the trick.
>
>
>Vinzent.

Yes, I think you are right about it. 

The fact is that reading from the port 0x40 left there since the old times when the code was written for Intel 8085 CPU (this is an industrial controller) and it had a totally different purpose. When I ported the code to DJGPP on x86 platform this place just went unnoticed and it never revealed itself until I made some re-arrangements in the program recently.

Thanks.

Alex Oleynikov

- Raw text -


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