Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!prls!pyramid!decwrl!turtlevax!jeff From: jeff@turtlevax.UUCP (Jeff Doughty) Newsgroups: net.micro.pc Subject: Re: Interrupts and Microsoft C Message-ID: <1172@turtlevax.UUCP> Date: Fri, 30-May-86 13:22:41 EDT Article-I.D.: turtleva.1172 Posted: Fri May 30 13:22:41 1986 Date-Received: Sun, 1-Jun-86 07:07:46 EDT Organization: CIMLINC, Inc. @ Menlo Park, CA Lines: 27 > I have an interrupt service routine which is linked with > my Microsoft 'C' application program. When the program is started > it installs the pointer to the service routine in the vector table. > As soon as the first interrupt is generated I get a stack overflow > message on the screen and the system hangs. If I disable the external > interrupt source everything works fine. Sounds like a problem in the > interrupt service routine. > I had a similar problem a few years ago with Lattice C. I don't know if it applies to you, and I'm real fuzzy about the details, but here goes. I wrote a short interrupt service routine in assembler which did a little setup (including resetting the segment registers) and then called a Lattice C routine. On the first interrupt I also got a stack overflow message. It turned out that the stack overflow checking code generated by the C compiler was the problem. When I recompiled the routine with the compiler flag to leave out overflow checking, it worked fine. (Here comes the fuzzy part.) It turned out that the overflow checking code compared the SP against some global value. Since I had reset the segment registers, I was accessing the wrong value. Hope this is of some help. Jeff Doughty Cimlinc, Inc.