🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6062

Re: Chaining interrupt handlers in Turbo C

#6062
From: Dave Andrews
Date: Mon, 29 Apr 1991 15:09
34 lines
1907 bytes
In article <1991Apr24.204727.27737@gupta.portal.com> few@gupta.portal.com (Frank Whaley) writes:
>In article <1991Apr17.214023.22334@bilver.uucp> dandrews@bilver.uucp (Dave Andrews) writes:
>
>> *  A week or so ago, someone asked:
>> *    "how can I chain to the next interrupt handler in Turbo C?"
>
>And Dave responded with a very interesting version of chain_intr().  I
>never would have thought of his method.  Unfortunately there are a
>couple of problems.
>
>  Interrupts are improperly chained if the interrupt handler function
>  has local variables.  Turbo C (2.0, I can't speak for TC++ or BC++)
>  only sets the BP register when the interrupt function uses local
>  variables, so it cannot be used in all cases to unroll the stack.

Indeed, this is a problem, but I only (obviously!) tested with global
variables.  I generally hesitate to use local variables in a procedure
of type INTERRUPT, because I don't know how big a stack is being
provided by the caller.

Outside of this problem, there is a "feature" in the code that found
its way into the posting.  I don't move enough of the stack (to quote
Maxwell Smart, "Missed it by THAT much").  Replace:
    mov  cx,12
by:
    mov  cx,13

Frank, is your ChainIntr function equivalent to the MSC _chain_intr
builtin?

Thanks for your comments and code!

- David Andrews
  bilver!dandrews
Technical Details
Message-ID: <1991Apr29.150944.12638@bilver.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!att!fang!tarpit!bilver!dandrews
References: <1991Apr17.214023.22334@bilver.uucp> <1991Apr24.204727.27737@gupta.portal.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!att!fang!tarpit!bilver!dandrews
From: dandrews@bilver.uucp (Dave Andrews)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Chaining interrupt handlers in Turbo C
Keywords: TC TURBOC interrupt _chain_intr
Message-ID: <1991Apr29.150944.12638@bilver.uucp>
Date: 29 Apr 91 15:09:44 GMT
References: <1991Apr17.214023.22334@bilver.uucp> <1991Apr24.204727.27737@gupta.portal.com>
Organization: W. J. Vermillion - Winter Park, FL
Lines: 34