home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!s.psych.uiuc.edu!amead
- From: amead@s.psych.uiuc.edu (Alan Mead)
- Subject: Re: Creating a TSR
- References: <ByyHw1.2vx@pcuf.fi> <Hendrik.Klompmaker.27.724459150@beheer.zod.wau.nl>
- Message-ID: <BzD80L.KHr@news.cso.uiuc.edu>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: UIUC Department of Psychology
- Date: Wed, 16 Dec 1992 18:43:32 GMT
- Lines: 43
-
- Hendrik.Klompmaker@beheer.zod.wau.nl (Hendrik Klompmaker) writes:
-
- >In article <ByyHw1.2vx@pcuf.fi> hammer@pcuf.fi (Mikko Uromo) writes:
- >>From: hammer@pcuf.fi (Mikko Uromo)
- >>Subject: Creating a TSR
- >>Date: Tue, 8 Dec 1992 19:52:49 GMT
- >>[Mikko is trying to write a TSR]
-
- >I tried some of the PD stuff around to make a TSR but find that nothing
- >beats the Turbo Power Object professional library. I only use parts of it
- >but it's sure worth the money.
-
- Yes. The absolute easiest way is to use the Turbo Power unit. It is
- shareware but I'm not sure that they keep releaseing new versions (at
- least to Internet). I emailed the authors for my v5.5 TPU.
-
- But I became disenchanted with a Pascal TSR because ASM is sooo much
- more efficient and I found a neat (PD last I heard) package, TBONES
- that makes it relatively easy to write a TSR (ie, *if* you know ASM).
- TBONES should be available from large FTP sites.
-
- If you are really interested in HOW to write a TSR (as opposed to just
- getting the job done), then I have a few bits of code. The problem
- (which I'll only sketch) is rather more complex than you seemed to
- think. DOS and some of the BIOS is NON-REENTRANT, meaning that if you
- call, a function twice (once by some application and the second time by
- you TSR that "pops-up" over the first app) the second call overwrites
- information neccessary for the first call to return. Thus after your
- TSR reliquishes control, execution resumes at some random point in
- memory and chaos ensues.
-
- The trick (art?) of figureing out when it is "safe" to pop-up is the
- hard part.
-
- Note that if you never want to call an interrupt, it is almost
- trivially easy to write a TSR. Just remember to shrink your heap (with
- $M directive) and terminate with Keep() rather than Halt() or "END.".
- For instance, I have a neat little TSR clock that uses Mem[:] to (1)
- read the time and (2) poke the nessessary string directly into video
- ram. Thus this TSR side-steps the whole nasty issue of when it is safe
- to issue a interrupt by not doing so.
-
- -alan
-