Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!diku!ballerup From: ballerup@diku.dk (Per Goetterup) Newsgroups: comp.lang.pascal Subject: Problems with interrupt handler for interrupt 08 or 1C in TP 6.0 Keywords: interrupt, timer, turbo pascal Message-ID: <1991Jan4.145541.17737@odin.diku.dk> Date: 4 Jan 91 14:55:41 GMT Sender: news@odin.diku.dk (Netnews System) Distribution: comp Organization: Institute of Computer Science, U of Copenhagen Lines: 50 Hi everybody! I'm having some rather weird problems with a program of mine which needs to get something updated on the screen no matter what else the program might be doing. I'm using interrupt 1C (User Timer Tick) to call my procedure which by the way DOESN'T call DOS (common error) - it only modifies the screen memory. The problem is not to get it to work (it does) but what happens next. I start it up by saving the old vector then re-assigning it to point at my handler (procedure). This does indeed work and the screen get modified as it should while my is running happily along. So far so good. Then something might happen because sometimes the computer simply stops in the middle of the program and lock up (refusing warm-boots), other times it runs all the way to the end and then crashes when returning to either the DOS prompt or Turbo's IDE (locks up again). At the end of my program I do remember to reset the vector to the old value, and I even have an error handler which does the same thing if an runtime error occurs. I also remember to call the old interrupt handler at the end of my new one. I've then tried to use interrupt 08 (Hardware Timer) which btw calls interrupt 1C during its processing. The result is the same. Crash on the way or at the end. I've even had an error free run but at the next attempt it crashed again. The conditions are always the same except the value of the timer count (time passes!). This random behaviour really bugs me! - If it's a programming error then it should occur at the same place every time - when the conditions are the same, right? - And no, I'm not using anything random inside the program WHAT SO EVER! Any ideas? - I feel I've tried it all, varying the compiler directives (but always $F+ around the handler) and so on. I've tried to turn interrupts on and off within the handler and sending an end-of-interrupt to the CPU at the end of my handler - no change at all!. Naturally I've checked both my program and the handler routine without using the interrupts and they run perfectly!. No stack or range violations! Any hints or ideas would be most appreciated! Loads of thanks in advance! Per. Reply by E-mail, but if it fails then please post your reply! PS: I'm using Turbo Pascal 6.0 Professional as stated in the subject field. -- | 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 - |