TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: CHRIS BERKHOUT
from: GLEN MCNABB
date: 1998-01-15 20:14:00
subject: Memory Allocation

On , Chris Berkhout wrote to Darryl Gregorash :
CB>  DG> Exactly; DOS merely assigns all available memory in one block to any
CB>  DG> program it loads, and it is then up to the application to manage 
hat
CB>  DG> it has been given.
CB>  DG> In this case, we wish to give up some of that memeory so we can
CB>  DG> request memory for a different purpose. In a .exe, you can achieve
CB>  DG> that with linker directives, in a .com you must write the code
CB>  DG> yourself.
CB>         Odd... with .exe's and .com's being treated the same by dos, with
CB>  regards to memory allocation, I'd have thought that a linker directive
CB>  would exist for both or none.
Well, with com's it had to do more with backward compadibility. Original
MSDOS 1.0 didn't run EXE programs. In "those" days, having more than
64K memory was a luxury. This is why dos loaded part of it's code
to the top of memory when running a program. To provide more room.
After version 2.xx, MSDOS couldn't boot in 64k memory.
It was a natural to give it all the memory then. There were no allocation
deallocation functions to use. There was no subdirectorys, no exe's,
and no handle type I/O funtions. So, they kept it that COM programs
would be assigned all memory, that way dos wouldn't have to compensate
for programs that ignored memory allocations.
Glen....
--- ProBoard v2.16 [Reg]
---------------
* Origin: NC/NEC SEWAnet, Bucolic Fair (1:3407/25)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.