Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!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.092908.24807@tygra.ddmi.com> Date: 9 Jan 91 09:29:08 GMT References: <25403@adm.brl.mil> <1991Jan6.150656.8281@odin.diku.dk> <1991Jan8.034315.15222@ims.alaska.edu> Organization: Moore Software, Detroit, MI Lines: 36 In article <1991Jan8.034315.15222@ims.alaska.edu> ftpam1@acad3.alaska.edu writes: >In article <1991Jan6.150656.8281@odin.diku.dk>, ballerup@diku.dk (Per Goetterup) writes... > >>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. The iret in ROM *is* the old routine. Nothing wrong with chaining to the default handler and letting it do the iret for you. Safest way to do it. >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. Once you've popped anything (registers, locals) you pushed onto the stack, it should be in the right state for the far jump. And you have to pop what you pushed anyway. You just don't get to let Turbo generate the code for you. I'd write an interrupt handler in asm to begin with, anyway. >Philip Munts N7AHL >NRA Extremist, etc. >University of Alaska, Fairbanks -- David R. Conrad dave@tygra.ddmi.com -- = 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