delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/30/10:48:24

Date: Sun, 30 Aug 1998 17:47:54 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Ignacio García Pérez <igp AT vlc DOT servicom DOT es>
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: <Pine.SUN.3.91.980830174729.20257k-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019