Path: utzoo!attcan!uunet!mcvax!sunic!ifi!tor!edb_tom From: edb_tom@tor.nhh.no (Tom Ivar Helbekkmo) Newsgroups: comp.lang.c Subject: Re: TSR's with TC Message-ID: <69@tor.nhh.no> Date: 23 Aug 89 03:10:21 GMT References: <3723@ncsuvx.ncsu.edu> Organization: NHH, Bergen, Norway Lines: 29 In article <3723@ncsuvx.ncsu.edu>, sherman@csclea.ncsu.edu (Chris Sherman) writes: > _chain_intr, which is usually used in an interrupt handler, accepts the > address of another interrupt handler, and jumps (not calls) over to it. > It is as if the first handler was never called. > > What can I do in TC to achieve the same effect? I thought of calling the > second interrupt handler like you would call any function, given its > address, but I'm not sure this will work correctly every time. No, you certainly can't do it that way. In MSC, when you declare a function "interrupt", you're telling the compiler that it will be used as an interrupt handler. The compiler then arranges for it to push all registers upon entry, *and restore them* on exit, then leave with an iret instead of a ret. In this scenario, the _chain_intr() function restores the registers, and then jumps to the specified place, which had better be another interrupt handler... :-) Correct me if I'm wrong, someone, but unless Turbo C has explicit support for writing interrupt handlers in C, you'll need to write your own (at the assembly level) to be able to do this sort of thing. I think the Blaise C Tools library is available for Turbo C -- it among other things helps you do interrupt processing in C. BCT is, in my opinion, a very good product, at a reasonable price. -tih -- Tom Ivar Helbekkmo, NHH, Bergen, Norway. Telephone: +47-5-959205 edb_tom@tor.nhh.no, thelbekk@norunit.bitnet, helbekkmo@nhh.uninett