Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

polling (Announce)

posted by mbbrutman Homepage, Washington, USA, 16.07.2011, 22:09

I meant to revisit this earlier. It's time to clean it up ...

DOS 2 and higher have INT 0x28 known as the idle handler. According to what I have read DOS may not have a idle handler installed. If it does not, then making INT 0x28 calls is harmless, but burns a few cycles. If there is an idle handler installed then it can make use of the fact that the foreground application has basically said 'I'm idle'. This function should always be safe to use.

Then there is INT 0x2F,1680 (the idle call). This is supported in DOS 5 and later versions of Windows, but there is a warning in the "Microsoft DOS 5 Programmers Reference" to check to ensure that INT 0x2F is not zero first before using it. It also has a return code to check to ensure that does something. It has the desired effect in a Windows XP command window.

I'd like one version of my executables to work in all of the environments. The simplistic way to do this is to get the DOS version and if DOS 5 or better is reported to verify INT 0x2F,1680 is installed and use it. (And if it returns 0, then continue using it.) If 0x2F,1680 does not work then fall back to using INT 0x28.

Does this seem reasonable?

---
mTCP - TCP/IP apps for vintage DOS machines!
http://www.brutman.com/mTCP

 

Complete thread:

Back to the forum
Board view  Mix view
22781 Postings in 2123 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum