delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/10/24/12:15:33

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Jason Mills <jmills AT cs DOT mun DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Timer inside interrupt handler
Date: Sun, 24 Oct 2004 13:05:32 -0230
Organization: Memorial University of Newfoundland
Lines: 30
Message-ID: <clgi45$pd8$1@coranto.ucs.mun.ca>
References: <clee5f$j5s$1 AT coranto DOT ucs DOT mun DOT ca> <01c4b948$Blat.v2.2.2$f034ea00 AT zahav DOT net DOT il>
NNTP-Posting-Host: jmills.ccore.mun.ca
Mime-Version: 1.0
X-Trace: coranto.ucs.mun.ca 1098632133 26024 134.153.38.195 (24 Oct 2004 15:35:33 GMT)
X-Complaints-To: usenet AT coranto DOT ucs DOT mun DOT ca
NNTP-Posting-Date: Sun, 24 Oct 2004 15:35:33 +0000 (UTC)
User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)
X-Accept-Language: en-us, en
In-Reply-To: <01c4b948$Blat.v2.2.2$f034ea00@zahav.net.il>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Eli Zaretskii wrote:
> How about reading the BIOS tick counter?  That's a simple memory read
> from a fixed address, so it should be safe.  The resolution you get is
> 54 msec.

How exactly? (As you can see I have not had much experience at
low level programming). _bios_timeofday() issues an Int
(according to the sources). I did come across the following on
the newgroup. Does it implement what you suggest?

   #include <go32.h>
   include <sys/farptr.h>

   A variable:

   long tick;

   Convert the real mode segment:offset pair to a linear address offset
   (relative to _dos_ds) like this:

   0x40 * 16 + 0x6c = 0x460

   Use it in the _farpeekl() function like this:

   tick = _farpeekl(_dos_ds, 0x460);

> OTOH, invoking any library functions that may issue Int 21h or other
> real-mode software interrupts is a no-no in an interrupt handler.

Thanks.

- Raw text -


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