News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Memory allocation problem

Started by Rogare, April 05, 2011, 11:34:25 AM

Previous topic - Next topic

Rogare

Hi,

I'm trying to allocate memory during run-time (21h/48h), but I keep getting error 8, saying largest available block is only 7 paragraphs (I need several blocks of 8 paragraphs).
Any idea what causes this limitation?

Thanks.

dedndave

it has been a while since i did this in 16-bit   :P
i seem to recall that you had to free heap space beyond the exe bss segment before allocating

FORTRANS

Hi,

   When running DOS programs, if you have not changed any
default behavior, the program is allocated all available memory
at program load.  Therefore, there will be no conventional memory
left to allocate.

   To free up memory, you either release memory when your
program starts using Int 21H, Fn 49H.  Or you link your program
with the /CPARMAXALLOC: option ( /CP: ).  /CP:1 is supposed
to only allocate to your program what it should need to load and
run.  (If you specify less memory than your program needs, LINK
is supposed to allocate what your program needs.  And most of
the time...)  If you know how much your program requires at
load, you can specify the number as /CP:##.  (Where ## is a
number specifying how much memory you need.)

HTH,

Steve N.

Rogare