home *** CD-ROM | disk | FTP | other *** search
Wrap
Newsgroups: alt.msdos.programmer Path: sparky!uunet!portal!resumix!news From: paul@resumix.portal.com (Paul Erickson) Subject: Re: .com and .exe files Message-ID: <1993Jan28.213145.7811@resumix.portal.com> Sender: news@resumix.portal.com Reply-To: paul@resumix.portal.com Organization: Resumix, Inc., Santa Clara, CA References: <1993Jan27.114320.14690@umr.edu> Date: Thu, 28 Jan 93 21:31:45 GMT Lines: 34 the standard action of a com file is to locate the data, stack and code all within one segment. However, their is not this limitation on the heap. Therefore, the program can allocate as much memory (malloc or getmem or new) as the machine has availiable. Also the CS and DS segment registers can be modified directly, but unless you are experienced with how DOS handles memory this is not a good idea. In article 14690@umr.edu, mcastle@cs.umr.edu (Michael R Castle) writes: >In article <C1HtvM.Eun@world.std.com> mikep@world.std.com (Michael Podanoffsky) writes: >> >>Both .com and .exe files can be loaded anywhere. >> >>A .com file contains no segments whatsoever. All data, code and stack share >>the same 64k segment. >> >>An .exe file contains segments and can exceed 64k. Only .exe files are really >>rommable should this ever be needed. One major side effect is that different >>code segments may be produced. >> >>.com files are an exact byte image of the program in memory without any >>relocation information. That means all references are near. > >Question: Can't com files use more than 64k? Once the program is going, >you can pretty much do what ever you want with the segment registers, and >request more memory, and access the full 640 k. I seem to remember a while >back that someone wrote a program (forth interpreter, if I remember >correctly) that is a .com file, but isn't limited by 64k. > >mrc >-- >Mike Castle .-=NEXUS=-. Life is like a clock: You can work constantly > mcastle@cs.umr.edu and be right all the time, or not work at all >S087891@UMRVMA.UMR.EDU and be right at least twice a day. -- mrc > We are all of us living in the shadow of Manhattan. -- Watchmen