Date: Sun, 30 Aug 1998 17:47:54 +0300 (IDT) From: Eli Zaretskii To: Ignacio García Pérez cc: djgpp AT delorie DOT com Subject: Re: HELP!... execute CODE in DATA segment seems not work In-Reply-To: <35e6eadc.3949780@crispin> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 8bit Precedence: bulk On Fri, 28 Aug 1998, Ignacio García Pérez wrote: > I've been playing around with the idea of using interrupt wrappers > located in C structures. But had no luck and can't guess what's wrong. Did you try to use _my_cs() isntead of _my_ds() in the following line: > B.selector=(word)_my_ds(); // New interupt vector will > The following code has an array of bytes which corresponds to a simple > interrupt service routine that just increments a variable. This code > is patched with the proper DS selector value and the proper offset of > the variable to be incremented. Your code has other problems, and even if using _my_cs() will help, the interrupt handler will almost surely crash. You don't lock the code and its data (TickCount); and you use DS that can be invalid, e.g. if somebody pressed Ctrl-C (use __djgpp_ds_alias instead).