🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TSR's - Must they be converted to .COM?

#4730
From: david nugent
Date: Sun, 17 Feb 1991 05:07
45 lines
2423 bytes
In <18798@brahms.udel.edu> boutell@brahms.udel.edu (Thomas B Boutell) writes:

> .COM files must fit within one 64k region, I believe. (Sorry, I can't 
> find my DOS bible; somebody borrowed it about a year ago. )-: Otherwise
> I'd give you the interrupt number.) 

INT 27H.

.COM files must be < 64K for two reasons:

	1) SS==DS==ES==CS on startup.  That means that your stack pointer is
	   pointing into your code segment at the top of the first 64K, and
	   can randomly trash stuff there due to hardware interrupts.  In
	   reality, the limit is something less than 64K, dependant on the
	   stack usage of ISR handlers, and maybe a little dependant on
	   luck. :-)

	2) DOS will simply not load a .COM file larger than 64K.  It's
	   easily possible to produce one (though most programming tools -
	   specifically linkers - tend to discourage it), but it won't
	   be too successful when it comes to executing it.
	   
	   And I'm talking about REAL .COM format binaries, not just .EXE's
	   which are renamed to .COM.  .EXE format is already known by DOS
	   and is tested for prior loading any binary file for execution,
	   despite it's extension which is why it's possible to rename a
	   .COM to a .EXE with no serious effects other than changing the
	   "execution priority" from the command line of that file.


> However, in versions of DOS from 2.0 on up, there is a call that will 
> allocate as many pages (16- byte increments) as you wish, and of course 
> nobody seriously uses versions of DOS prior to 2.0 any longer.

Just for reference, INT 21H, function 31H.

One important aspect of using this function is that you can pass an
errorlevel back to the parent, which is not possible with INT 27H.


	david
-- 
        Fidonet: 3:632/348   SIGnet: 28:4100/1  Imex: 90:833/387
              Data:  +61-3-885-7864   Voice: +61-3-826-6711
 Internet/ACSnet: david@csource.oz.au    Uucp: ..!uunet!munnari!csource!david
Technical Details
Message-ID: <1013@csource.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!csource!david
References: <3188@unccvax.uncc.edu> <18798@brahms.udel.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!csource!david
From: david@csource.oz.au (david nugent)
Newsgroups: comp.os.msdos.programmer
Subject: Re: TSR's - Must they be converted to .COM?
Keywords: TSR
Message-ID: <1013@csource.oz.au>
Date: 17 Feb 91 05:07:47 GMT
References: <3188@unccvax.uncc.edu> <18798@brahms.udel.edu>
Organization: Unique Computing Pty Ltd, Melb, Aust.
Lines: 45