home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7524 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  1.8 KB

  1. Path: sparky!uunet!news.tek.com!vice!bobbe
  2. From: bobbe@vice.ICO.TEK.COM (Robert Beauchaine)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: Creating a TSR
  5. Message-ID: <10974@vice.ICO.TEK.COM>
  6. Date: 16 Dec 92 20:32:41 GMT
  7. References: <ByyHw1.2vx@pcuf.fi> <Hendrik.Klompmaker.27.724459150@beheer.zod.wau.nl> <BzD80L.KHr@news.cso.uiuc.edu>
  8. Organization: Tektronix, Inc., Beaverton,  OR.
  9. Lines: 31
  10.  
  11. In article <BzD80L.KHr@news.cso.uiuc.edu> amead@s.psych.uiuc.edu (Alan Mead) writes:
  12. >Hendrik.Klompmaker@beheer.zod.wau.nl (Hendrik Klompmaker) writes:
  13. >
  14. >If you are really interested in HOW to write a TSR (as opposed to just
  15. >getting the job done), then I have a few bits of code.  The problem
  16. >(which I'll only sketch) is rather more complex than you seemed to
  17. >think.  DOS and some of the BIOS is NON-REENTRANT, meaning that if you
  18. >call, a function twice (once by some application and the second time by
  19. >you TSR that "pops-up" over the first app) the second call overwrites
  20. >information neccessary for the first call to return.  Thus after your
  21. >TSR reliquishes control, execution resumes at some random point in
  22. >memory and chaos ensues.
  23.  
  24.   For the best discussion I've ever seen on this subject, find a
  25.   copy of _Turbo_Pascal_Advanced_Programmer's_Guide_.  It addresses
  26.   every part of TSR programming, including stack switching,
  27.   reentrancy, unloading, checking for a running copy, etc.  
  28.  
  29.   I know the book is out of print, but if you can find a used copy,
  30.   it's worth this single chapter alone.  Lot's of other good stuff,
  31.   too.
  32.  
  33.  
  34. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 
  35.  
  36. Bob Beauchaine bobbe@vice.ICO.TEK.COM 
  37.  
  38. C: The language that combines the power of assembly language with the 
  39.    flexibility of assembly language.
  40.  
  41. Real friends don't let friends use UNIX.
  42.