Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!hayes.ims.alaska.edu!acad3.alaska.edu!ftpam1 From: ftpam1@acad3.alaska.edu (MUNTS PHILLIP A) Newsgroups: comp.lang.pascal Subject: Re: Problems with timer interrupts Message-ID: <1991Jan8.034315.15222@ims.alaska.edu> Date: 8 Jan 91 03:43:15 GMT References: <25403@adm.brl.mil> <1991Jan6.150656.8281@odin.diku.dk> Sender: usenet@ims.alaska.edu (J Random USENET) Reply-To: ftpam1@acad3.alaska.edu Organization: University of Alaska Fairbanks Lines: 31 News-Software: VAX/VMS VNEWS 1.3-4 Nntp-Posting-Host: acad3.alaska.edu In article <1991Jan6.150656.8281@odin.diku.dk>, ballerup@diku.dk (Per Goetterup) writes... [much deleted] >Also, when should I call the old service routine from within my new one? - >First, last or in the middle? Unless you run your program from another that uses INT 1CH, there won't BE any old routine. The vector points to an IRET in ROM on my machine (286 with DOS 3.3) unless changed by the user program. If you are simply running one program from DOS, just point the vector to an interrupt procedure in the TP6 program. You should reset the vector in an exit routine (Programmer's Guide p. 247), not just at the end of the main program. Otherwise, abnormal program exit (like HALT, run time error, or ^C) will hash DOS for you by leaving vectors pointing into never never land (where your program used to be). If you are nesting programs that use INT 1CH, you will need to carefully consider what you want to happen before chaining the INT 1CH interrupt procedures. Should you decide to chain, you should do it at the end of the interrupt procedure, after saved registers have been unstacked (but leave flags and return address) and before the final IRET, which should be replaced by a long jump to the original service procedure. This all requires a lot of inline machine code to get the stack in the right state before the long jump. If you think this is bad, just wait until you try ^C and/or BREAK handlers. Philip Munts N7AHL NRA Extremist, etc. University of Alaska, Fairbanks