Running long memory intensive programs!

David T. Lindsley dlindsle at afit.af.mil
Fri Jun 14 02:25:33 AEST 1991


DOS will only recognize 1Meg of memory (based on the 8086's 16-bit
address bus, plus a 4-bit segment register).  Of this, the upper
384K are reserved by DOS for itself, leaving 640K.  What extended
memory managers actually do is fool DOS into thinking there's more
memory than there really is.  In addition, they relocate device
drivers (e.g. MOUSE.SYS, VDISK.SYS, ANSI.SYS) and other memory-
resident stuff in those 384K of "high memory", which leaves more of
your 640K base memory available for whatever.

But even a "far" (20-bit) pointer is still only going to be able to
address 1Meg of memory.  i.e. if you've got arrays or other chunks
of data or code bigger than ~600K, you're in trouble (that's why you
need a 386-based compiler).  Overlays can reduce your code size into
manageable chunks.  A 250x250 double-precision array is half a meg
(which doesn't leave you a lot of space for the rest of your data,
let alone the code).

If your data is in smaller chunks, you may be able to do something
with a memory manager (or try and let Windows do "paging" for you).
Good luck; my experience tells me you'll need it.

-- 
Dave Lindsley	#24601#			OPINIONS.  MINE.  (Nobody tells me
dlindsle at blackbird.afit.af.mil		  anything anyway, so I can't possibly 
    ?? lamroN eb yhW ??			  be anybody's mouthpiece...)



More information about the Comp.lang.c mailing list