Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!umich!sharkey!tygra!dave From: dave@tygra.ddmi.com (David Conrad) Newsgroups: comp.lang.pascal Subject: Re: Problems with timer interrupts Message-ID: <1991Jan9.091449.24207@tygra.ddmi.com> Date: 9 Jan 91 09:14:49 GMT References: <25403@adm.brl.mil> <1991Jan6.150656.8281@odin.diku.dk> Organization: Moore Software, Detroit, MI Lines: 40 In article <1991Jan6.150656.8281@odin.diku.dk> ballerup@diku.dk (Per Goetterup) writes: >I've also got suggestions (from elsewhere) to use interrupt 16h (keyboard >I/O) which gets called every time the machine isn't too busy doing hard CPU >or disk work. Anybody got expirences in using this??? This is not true. 16h is called by the running program to get keystrokes from the keyboard or to check to see if any are waiting in the buffer. It's called as often as the running program calls it - no more and no less. This is usually fairly frequently, but can be arbitrarily infrequent if the program is busy, or worse, stuck. There is an interrupt which is called when the computer is idle, 28h, called the DOS Idle interrupt. The only place I know of this being called from is interrupt 21h function 1, get keyboard input. DOS calls 28h in a loop while waiting for keystrokes. If a program does its input via the BIOS (16h) instead of DOS (21h) then 28h won't normally be called. >Also, when should I call the old service routine from within my new one? - >First, last or in the middle? Last. You want to do a far jump to the old handler instead of an iret to exit your handler. The old handler will either do the iret or a far jump to an even 'older' handler. Somewhere down the line the iret will be done (otherwise the computer wouldn't have been working before you installed your handler). Exiting your handler in this way allows all the handlers which are chained to the interrupt to 'see' it and get their crack at servicing it. This makes your handler 'well behaved'. >-- >| Per Gotterup | "The most merciful thing in the | >| Student, DIKU (Dept. of Comp. Sci.) | world, I think, is the inability | >| University of Copenhagen, Denmark | of the human mind to correlate all | >| Internet: ballerup@freja.diku.dk | its contents." - H.P. Lovecraft - | -- David R. Conrad dave@tygra.ddmi.com uunet!tygra!dave -- = CAT-TALK Conferencing Network, Computer Conferencing and File Archive = - 1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new' - = as a login id. AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET") = E-MAIL Address: dave@DDMI.COM