Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!umd5!umbc3!dipto From: dipto@umbc3.UMD.EDU (Dipto Chakravarty ) Newsgroups: comp.sys.ibm.pc Subject: Re: MSC medium model TSR questions Message-ID: <578@umbc3.UMD.EDU> Date: Mon, 16-Nov-87 13:58:11 EST Article-I.D.: umbc3.578 Posted: Mon Nov 16 13:58:11 1987 Date-Received: Wed, 18-Nov-87 05:45:36 EST References: <8711130253.AA04513@decwrl.dec.com> <263@westmark.UUCP> Reply-To: dipto@umbc3.UMD.EDU (Dipto Chakravarty (CMSC)) Organization: University of Maryland, Baltimore County Lines: 34 In article <263@westmark.UUCP> dave@westmark.UUCP (Dave Levenson) writes: >In article <8711130253.AA04513@decwrl.dec.com>, desmond@smaug.dec.com writes: >> I am working on a program that I want to terminate and stay resident and >> I have several questions that I would like answers to... > >> 1) How does one figure out where to mark the end of resident memory? > >I suggest that you call malloc() requesting 16 bytes. That will get >you the next available address in the heap above your data. Round >that address up to the next paragraph boundary, and pass that as the >end-mark in your tsr system call. >-------- Is there an equivalent of _TSIZE (in Lattice C) variable that holds the size of the loaded program in Microsoft ? If so then you can do the following: #include main () { extern int _TSIZE; union REGS input, output; input.x.ax = 0x3112 /*31H...return code*/ input.x.ax = _TSIZE; /*the program size */ intdoss(&input,&output);/*function call 31 */ } I will be interested to know how this project is coming up, as I myself is in the middle of developing a TSR based communications software. Feel free to send me email. FYI, I used to work with Lattice C before getting into this program which needed to be done in Microsoft 4.0. Of course, there is nothing like Unix on a VAX! (but ...) Dipto