X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Jason Mills 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: References: <01c4b948$Blat.v2.2.2$f034ea00 AT zahav DOT net DOT il> NNTP-Posting-Host: jmills.ccore.mun.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 Precedence: bulk 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 include 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.