From: "Michael Schuster" Organization: LS f. Elektr. Energieversorgung To: snarfy AT goodnet DOT com, djgpp AT delorie DOT com Date: Wed, 18 Dec 1996 08:24:36 MEZ Subject: Re: Accessing Data in an interrupt handler Message-Id: Hi Snarfy! > > Hardware Interrupts with C Thanks for the Asembler routine (although I don't understand any part of it). > short data[11][120] is stored in the data segment of your program if > you declared it globally. In an interrupt handler, the data segment > register (%ds) is set by the DPMI provider. With this new %ds, all > access to your C variables will SIGSEGV. I've declared them as global, your right and used _go32_dpmi - functions. But I still donot understand why the Interrupt works, the programm is running, but when releasing the interrupt or shutting down the program, why the program crashes. Also non array, global variables, are still in use in my interrupthandler, and they don't harm anything (till now). Is this ok, then? (perhaps you explained that with the register %ds, but as I told I don't know anything about registers, asembler ...) > And then install it with the __dpmi_set_.... Don't use the _go32_dpmi > functions to install this, as it won't work. The _go32_dpmi functions > expect the function to 'ret' not 'iret', which is a bad thing because > there is a race condition and you can't lock the code really well. Hmm?? Thanks again. I will test it. Michi BTW: Allegro is wunderful! ********************************************** Michael Schuster E-mail: Schuster AT eev DOT e-technik DOT uni-erlangen DOT de Universitaet Erlangen/Nuernberg Lehrstuhl fuer Elektrische Energieversorgung Cauerstrasse 4 91058 Erlangen http://www.eev.e-technik.uni-erlangen.de/ **********************************************