delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/21/03:17:01

Date: Thu, 21 Aug 1997 10:14:28 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "A. Sinan Unur" <asu1 AT cornell DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: Function Sizes (how to in asm?)
In-Reply-To: <33FAE4E3.247F@cornell.edu>
Message-ID: <Pine.SUN.3.91.970821101322.26010I-100000@is>
MIME-Version: 1.0

On Wed, 20 Aug 1997, A. Sinan Unur wrote:

> i need some clarification/pointers on
> how to proceed once you have the handler in assembly.

Put a label at the end of your handler.  Then subtract the address of
the handler from the address of that label and pass the result as the
size of locked region to the DPMI function 0600h (or call
`__dpmi_lock_linear_region' library function).

> my interrupt
> handler is very simple (just adds a 32 bit number to a global
> queue),

Remember to also lock this global queue.  Since the size of a variable
is easily computed, this should present no problems.

> i guess the point about assembly is that it is not subject to further
> optimization by the compiler and the size of the function will remain
> fixed, correct? in that case, my question is answered.

No, the problems with C functions are that (1) there's no way to
compute their size (hence the trick with dummy functions around the
handler); and (2) you don't have any control about what goes on on the
stack in the code produced by the compiler, and so cannot easily lock
the portion of stack that gets touched by the handler.

- Raw text -


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