interrupt far functions in Microsoft 5.1
Andreas Kaiser
kaiser at ananke.stgt.sub.org
Tue Jan 22 07:38:28 AEST 1991
In a message of <Jan 18 17:19>, Don Lorvig (lorvig at gsg.UUCP ) writes:
DL> have been using void far interrupt routines for some time now. The
DL> addresses of this routines are passed to a TSR which executes them.
DL> Recently I began attempting to make this functions more complex. (They
DL> merely set flags before). When I attempt function calls from within
DL> these interrupt routines, strange behavior results.
I don't know if this is applicable to your problem, but the following is a
common problem with interrupt routines in C (and perhaps the reason for the more
sophisticated interrupt library in Zortech C):
Interrupt functions are called from everywhere, so you cannot assume the stack
segment is the same as the data segment, which is a requirement at least for the
small data models (small, medium). Thus an address within the interrupt
function's stack frame (of a local variable) cannot be addressed via a near
pointer, not even within the interrupt function itself. Should not be a problem
in MSC's large model unless pointers are explicitly qualified as "near", but you
didn't tell the model used.
Andreas
More information about the Comp.lang.c
mailing list