Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!ptsfa!ihnp4!homxb!whuts!picuxa!gp From: gp@picuxa.UUCP (Greg Pasquariello X1190) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Accessing data from an interrupt handler Message-ID: <330@picuxa.UUCP> Date: Thu, 8-Oct-87 10:11:04 EDT Article-I.D.: picuxa.330 Posted: Thu Oct 8 10:11:04 1987 Date-Received: Sun, 11-Oct-87 11:50:56 EDT Organization: AT&T Information Systems, Parsippany NJ Lines: 31 Xref: mnetor comp.sys.ibm.pc:8851 comp.lang.c:4778 I ran into a small problem today, and I was wondering if anyone could shed some light on it. I wrote a test program in MSC 4.0 that will set up an interrupt handler for the clock interrupt (0x1C). The interrupt handler itself was a small ASM module that simply printed out stars whenever the interrupt occured. Fine. The next thing I did was change the int handler to increment a word of memory (a variable) rather than print stars, and when the interrupt was done being serviced, the C program printed the value of the variable. Problem was, the value was ALWAYS 0. I then ran the interrupt handler and the C code (a single, small model program) through Codeview, and found that the variable *WAS* being incremented. Now can anyone tell me why the variable is incremented when the routine is used as a called function, but not when the routine is used as an interrupt routine? The MSC routines are compiled using the small memory model option, and the ASM routine is set up to be compatible with the C code (_TEXT segment, _DATA segment, DGROUP, and all that). All publics are declared within the ASM module, and properly begin with an '_'. The code is linked as one program with the interrupt handler embedded, and the routine that sets up the new interrupt vector does so correctly. Any help will be appreciated. Thanks in advance. BTW: Thanks to all who responded to my question about the "hole" in the stack. The answer dawned on me just after I posted the question! Greg Pasquariello