Mail Archives: djgpp/1998/08/30/10:48:24
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).
- Raw text -