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

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" <eliz AT gnu DOT org>
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>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 2.2.2
In-reply-to: <clgi45$pd8$1@coranto.ucs.mun.ca> (message from Jason Mills on
Sun, 24 Oct 2004 13:05:32 -0230)
Subject: Re: Timer inside interrupt handler
References: <clee5f$j5s$1 AT coranto DOT ucs DOT mun DOT ca> <01c4b948$Blat.v2.2.2$f034ea00 AT zahav DOT net DOT il> <clgi45$pd8$1 AT coranto DOT ucs DOT mun DOT ca>
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

> From: Jason Mills <jmills AT cs DOT mun DOT ca>
> Date: Sun, 24 Oct 2004 13:05:32 -0230
> 
>    #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);

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.

- Raw text -


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