Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!pasteur!ames!hc!lanl!opus!dante!pgaughan From: pgaughan@dante.nmsu.edu (Patrick Gaughan) Newsgroups: comp.sys.ibm.pc Subject: Re: More assembly questions about TSR development. Keywords: TSR, .EXE Message-ID: <210@opus.NMSU.EDU> Date: 27 Apr 89 16:08:34 GMT References: <4550@tekigm2.MEN.TEK.COM> Sender: news@nmsu.edu Reply-To: pgaughan@dante.UUCP (Patrick Gaughan) Distribution: na Organization: New Mexico State University Lines: 40 Q: Can a TSR be an .EXE? Yes. Q: Why is there no stack segment defined in the TSR source listings I've seen? The TSR listings you have been looking through have been .COM TSR's. In a .COM file there can only be one segment and CS, DS, ES, and SS all point to that segment on program startup. EXE2BIN will not work if more than one segment is defined. But, if you want your TSR to be a .EXE, don't bother to use EXE2BIN. Also, a few more differences between .COM's and .EXE's: .COM's have a ORG 100h at the beginning of the code segment to make room for the PSP (Program Segment Prefix). .EXE's do not need this since DOS allocates a PSP for them on startup. .EXE's can have an entry point anywhere within the code segment while .COM's must start at 100h (right after the ORG). Since .COM files are limited to 1 segment, this generally implies 64k is the limit on the size of the final code (although I'm sure there is a way around this...) Also, when developing TSR's, using DOS function calls (INT 21h) on interrupt is a very tricky business and many articles should be read before doing it yourself... Suggested references: PC magazine - whenever they have a TSR utility, read the article DOS Technical Reference Manual The Waite Group's MS-DOS Developer's Guide MS-DOS Advanced Programming Disclaimer:"I know NOTHING! NOTHING!" (German accent implied...) Brought to you by the developer of TSR NCSA Telnet, (Please don't flood me with mail, a 256k TSR is not that useful yet...) Patrick Gaughan Programmer of Gor pgaughan@nmsu.edu New Mexico State University