home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / msdos / programm / 9130 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  2.9 KB

  1. Path: sparky!uunet!bonnie.concordia.ca!hobbit.ireq.hydro.qc.ca!beaurega
  2. From: beaurega@ireq.hydro.qc.ca (Denis Beauregard)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Results of the smallest TSR contest
  5. Message-ID: <Bu7wAJ.Ks6@ireq.hydro.qc.ca>
  6. Date: 7 Sep 92 16:54:19 GMT
  7. References: <2aa36355@ralf> <1992Sep2.213536.28873@zooid.guild.org> <BtzEp4.5n3.2@cs.cmu.edu>
  8. Sender: news@ireq.hydro.qc.ca (Netnews Admin)
  9. Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada
  10. Lines: 45
  11.  
  12. OK.  Well, I checked in my office PC for a true _useful_ TSR program.
  13. If we accept that a TSR is not necessary using the TSR command, then
  14. the place wasted by PSP is saved.  This improves somewhat what the
  15. smallest possible will be.
  16.  
  17. In that context, the program will be the assembly code of the program, 
  18. plus the 5 bytes for the memory control block, with a 16-bytes border.
  19.  
  20. I wrote such a TSR that takes some 40 bytes.  It is working (my colleague
  21. needed it to bypass a bug in his machine BIOS) while the example I gave
  22. was not (I just tried to evaluate what was the smaller, just to see if
  23. 64 was the smallest possible).  This TSR which I called PATCH19 works
  24. on one machine (i.e. patch is useless on other machines which have not
  25. the same bug), is in Assembler (Borland supports _AX etc., but the program
  26. was using many co-processor instructions) and was useful.  
  27.  
  28. Anyway, there are 2 conclusions to that contest : the smallest TSR is
  29. 32 bytes (the memory manager will give you 16 bytes or more and will
  30. use 5 of 16 more bytes).  Thus, if you can patch something in 27 bytes
  31. and can be sure the MCB is just below the memory block you get, then the
  32. program will be the smallest.  I just wonder if in future releases of DOS,
  33. the MCB header will be movable, in which case the patch must be 16
  34. bytes to be the smallest.
  35.  
  36. Obviously, if you want to do something useful (not necessary something the
  37. computer user will notice), you may need more than 32 bytes!  But some
  38. patches will need only a few bytes and _are_ useful.
  39.  
  40. Second conclusion is that the smallest TSR will not use the TSR facility
  41. provided by DOS.  Thus, maybe a suggestion for the FAQ list (even if not
  42. an FAQ!) : to get the smallest TSR, try 1st to allocate a memory block,
  43. and if no one found, then use the PSP.
  44.  
  45. Finally, not a conclusion, but merely a comment : there seems to be no
  46. straight frontier between HLL and Assembler.  In Borland C, you can
  47. use registers.  In Intel PLM, you can use pseudo-instructions like
  48. enable() or disable().  Years ago, I dreamed of an Assembler language
  49. supporting direct HLL calling convention.  But, today there are HLL
  50. compilers supporting many Assembler features.
  51.  
  52. -- 
  53.   \_\    Denis Beauregard  *  internet:beaurega@ireq.hydro.qc.ca
  54.  /   \   Genealogiste officiel : Beauregard/Jarret/Jarest/Vincent
  55. J   __>  Un Quebec renouvele dans une Amerique renovee
  56. \_.-===                                                  Opinions ? Et pis non !
  57.