TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Dominique Curtis
from: Kurt Kuzba
date: 1998-12-10 04:22:06
subject: TC++ Delay() function...

DC>   what were the connect_error/text_connect functions for?
   Those were just pretend. They were meant to represent the
   door code which tests for timeouts online and loss of
   carrier. I don't know if you have to hardcode those or if
   there is an ISR that kicks the door back to the system if
   the DTR drops or too much time passes with no activity.
   You might want to look into using the BIOS timer, which
   keeps the system clock ticks since midnight.
   You can find it at 0x0040006c. An unsigned short value at
   that address will hold the fractional hours, each 65336
   ticks being one hour, and the unsigned short at 0x0040006e
   should hold the number of hours since midnight. This gives
   you your standard 18.2 ticks per second, independent of your
   application. If something in your system is messing around
   with the timer, it SHOULD have an ISR to adjust the rate of
   incrementation for the BIOS timer, but you cannot rely on it.
   In general, under DOS, you can set up a timer variable:
unsigned short volatile BIOStime, release;
release = BIOStime = *((unsigned short*)0x0040006cL);
release += 9;        /* add 1/2 second         */
release &= 0xffff;   /* mask any rollover bits */
while(
   release < *((unsigned short*)0x0040006cL) ||
   BIOStime <= *((unsigned short*)0x0040006cL) )
   release_time_slice();
/*
   If the int rollover is included in the pause, this will wait
   until the rollover occurs before allowing continuance.
*/
while(release > *((unsigned short*)0x0040006cL))
   release_time_slice();
/*
   This causes the routine to pause until the appointed time
*/
   The bogus call to release_time_slice() would be replaced by
   whatever code you would be using to make your app multitask
   friendly. It would return the unused portion of its time to
   the Operating System to be used to keep the other apps going.

> ] And that's all I have to say about that. [ F. Gump ]........

---
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 639/252
SEEN-BY: 670/218
@PATH: 154/750 222 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.