TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: KEN HRYNCHUK
from: CRAIG HART
date: 1998-01-30 13:43:00
subject: RT Delay Bug?

Hi..
 > Can anyone tell me why the following attempt at a real-time delay
 > aborts at midnight (under MS-DOS), and not at the changing of the
 > hour? Any fixes/explanations will be greatly appreciated.
 > I've got a sneaking suspicion that I'm overlooking something quite
 > simple. :)
1. is DS pointing to your data? or off into space somewhere?
   (I'm not familiar with CHASM and hw it sets the registers...)
2. Since you only test the LSW of the timer tick, each time the LSW rolls 
over    from FFFF to 0000 you'll get a hang. In fact, any timer tick value 
that is
   more than (65535-number of ticks to wait) at the start of the loop will
   result in a hang. Why? because initial+number of ticks excees the capaciy 
of
   the LSW only.
Perhaps, an example:
Initial timer tick value : = 65530
number of ticks to count : = 180
final tick value         : = 65710
The 'range' if LSW is only 0 to 65535, however, so the target is never 
reached. The best solution is to include code to acomidate this rollover.
    Craig
--- FMail/386 1.20+
---------------
* Origin: Communications Barrier BBS (03) 9585 1112, 24hrs (3:632/533)

SOURCE: echomail via exec-pc

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™.