X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Sun, 24 Oct 2004 20:57:34 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-ID: <01c4b9fb$Blat.v2.2.2$77a44280@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2 In-reply-to: (message from Jason Mills on Sun, 24 Oct 2004 13:05:32 -0230) Subject: Re: Timer inside interrupt handler References: <01c4b948$Blat.v2.2.2$f034ea00 AT zahav DOT net DOT il> 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 > From: Jason Mills > Date: Sun, 24 Oct 2004 13:05:32 -0230 > > #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); Yes, that's it, except that the correct address is 0x46c, as Martin points out. Also, there's the midnight roll-over flag at 0x470. You may wish to look at it if your code needs to handle the case where the counter at 0x46c is reset when midnight passes. If you are looking for more documentation about these, Ralf Brown's Interrupt List is a good place.