[comp.lang.c] TSR

PNU@PSUVM.BITNET (03/02/88)

Does anyone have any experience in writing TSR (Terminate & Stay Ready)
programs in either Microsoft C 5.0 or MS QuickC? Specifically, has
anyone made use of the _chain_intr, _dos_getvect, _dos_setvect and/or
_dos_keep functions?

The runtime library reference, which provides reasonably good examples
for most functions, has very little info. on these.

I'd appreciate any information about how to apply any or all of these
functions. Also, if someone has a short example handy, I'd sure like
to see the source code!

                                      Thanks,
                                       Jon


P.S:  Please don't respond that I should use assembly language. If
      I wanted to use MASM, I would, and a reader full of flames
      from assembler wonks won't help me learn C, which is the
      whole purpose of this exercise.


*****************************************************************

Jon Peters                               "Any opinions expressed
                                          or implied are solely
PNU@PSUVM.BITNET                          those of the author,
JAP@PSUARLC.BITNET                        who does not speak for
JAP@PSUECLA.BITNET                        ARL/PSU."

Research assistant,
The Applied Research Laboratory/PSU         (814) 865-4229
P.O. Box 30, State College PA   16804
*****************************************************************

mccarthy@well.UUCP (Patrick McCarthy) (03/08/88)

From ptsfa!ames!nrl-cmf!ukma!psuvm.bitnet!pnu Mon Mar  7 18:25:45 PST 1988
In article <34910PNU@PSUVM> PNU@PSUVM.BITNET (Jon Peters) writes:

> Does anyone have any experience in writing TSR (Terminate & Stay Ready)
> programs in either Microsoft C 5.0 or MS QuickC? Specifically, has
> anyone made use of the _chain_intr, _dos_getvect, _dos_setvect and/or
> _dos_keep functions?
> 
> The runtime library reference, which provides reasonably good examples
> for most functions, has very little info. on these.

I hate to tell you this, but using these library routines can be a
royal *PAIN* for someone new to C and/or the IBM PC (and even for
those who aren't), primarily because of DOS reentrancy problems
(i.e., a TSR can't use DOS if the foreground process is already
using it).  I don't want to sound like a living advertisement, but
Blaise Computing offers a package called C TOOLS PLUS/5.0, which
provides a number of routines to help support writing TSRs which go
way beyond the MSC library routines, as well as text windows, menus,
screen access, and a whole bunch of other stuff. It costs about $175,
but it may save you ten times that much in headaches.  It also comes
with lots of example programs written in C, documentation, and source
(mostly C). This package is functionally almost identical to our
product Turbo C TOOLS (for Turbo C), which has a write-up in this month's
Turbo Technix magazine.

		Blaise Computing
		2560 Ninth Street, Suite 316
		Berkeley, CA 94710
		(415) 540-5441	    <- Technical support/technical questions
		(800) 333-8087	    <- Orders only

Pat McCarthy
mccarthy@well.uucp
well!mccarthy@lll-crg.arpa

P.S.: Actually, TSR stands for Terminate and Stay Resident.

Devin_E_Ben-Hur@cup.portal.com (03/09/88)

The Feb. & Mar. issues of Computer Language magazine contain two
articles on writing TSR's in Turbo C and MSC/QuickC respectively.