🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1334

Re: Results of the smallest TSR contest

#1334
From: Denis Beauregard
Date: Mon, 07 Sep 1992 16:54
45 lines
2999 bytes
OK.  Well, I checked in my office PC for a true _useful_ TSR program.
If we accept that a TSR is not necessary using the TSR command, then
the place wasted by PSP is saved.  This improves somewhat what the
smallest possible will be.

In that context, the program will be the assembly code of the program, 
plus the 5 bytes for the memory control block, with a 16-bytes border.

I wrote such a TSR that takes some 40 bytes.  It is working (my colleague
needed it to bypass a bug in his machine BIOS) while the example I gave
was not (I just tried to evaluate what was the smaller, just to see if
64 was the smallest possible).  This TSR which I called PATCH19 works
on one machine (i.e. patch is useless on other machines which have not
the same bug), is in Assembler (Borland supports _AX etc., but the program
was using many co-processor instructions) and was useful.  

Anyway, there are 2 conclusions to that contest : the smallest TSR is
32 bytes (the memory manager will give you 16 bytes or more and will
use 5 of 16 more bytes).  Thus, if you can patch something in 27 bytes
and can be sure the MCB is just below the memory block you get, then the
program will be the smallest.  I just wonder if in future releases of DOS,
the MCB header will be movable, in which case the patch must be 16
bytes to be the smallest.

Obviously, if you want to do something useful (not necessary something the
computer user will notice), you may need more than 32 bytes!  But some
patches will need only a few bytes and _are_ useful.

Second conclusion is that the smallest TSR will not use the TSR facility
provided by DOS.  Thus, maybe a suggestion for the FAQ list (even if not
an FAQ!) : to get the smallest TSR, try 1st to allocate a memory block,
and if no one found, then use the PSP.

Finally, not a conclusion, but merely a comment : there seems to be no
straight frontier between HLL and Assembler.  In Borland C, you can
use registers.  In Intel PLM, you can use pseudo-instructions like
enable() or disable().  Years ago, I dreamed of an Assembler language
supporting direct HLL calling convention.  But, today there are HLL
compilers supporting many Assembler features.

-- 
  \_\    Denis Beauregard  *  internet:beaurega@ireq.hydro.qc.ca
 /   \   Genealogiste officiel : Beauregard/Jarret/Jarest/Vincent
J   __>  Un Quebec renouvele dans une Amerique renovee
\_.-===                                                  Opinions ? Et pis non !
Technical Details
Message-ID: <Bu7wAJ.Ks6@ireq.hydro.qc.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!bonnie.concordia.ca!hobbit.ireq.hydro.qc.ca!beaurega
References: <2aa36355@ralf> <1992Sep2.213536.28873@zooid.guild.org> <BtzEp4.5n3.2@cs.cmu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!bonnie.concordia.ca!hobbit.ireq.hydro.qc.ca!beaurega
From: beaurega@ireq.hydro.qc.ca (Denis Beauregard)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Results of the smallest TSR contest
Message-ID: <Bu7wAJ.Ks6@ireq.hydro.qc.ca>
Date: 7 Sep 92 16:54:19 GMT
References: <2aa36355@ralf> <1992Sep2.213536.28873@zooid.guild.org> <BtzEp4.5n3.2@cs.cmu.edu>
Sender: news@ireq.hydro.qc.ca (Netnews Admin)
Organization: Institut de recherche d'Hydro-Quebec, Varennes, Canada
Lines: 45