Date: Thu, 21 Aug 1997 10:14:28 +0300 (IDT) From: Eli Zaretskii To: "A. Sinan Unur" cc: djgpp AT delorie DOT com Subject: Re: Function Sizes (how to in asm?) In-Reply-To: <33FAE4E3.247F@cornell.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.