PRB:Available Memory in C with More than 20 Files & PC-DOS 3.3

ID Number: Q40785

5.10 | 5.10

MS-DOS | OS/2

Summary:

If the CRTODAT.ASM file is modified per the instructions in the C 5.1

README.DOC file to increase the number of file handles from 20 to 30,

building a .EXE file with the modified CRTODAT will cause the .EXE to

use about 64K more if running PC-DOS 3.3 than if running MS-DOS 3.3.

Note: If CRT0DAT is not linked, then the difference in the available

memory between MS-DOS 3.3 and PC-DOS 3.3 is negligible.

All memory models will produce results similar to those described

above.

More Information:

The only workarounds are to not link with a modified CRT0DAT.ASM, or

to use MS-DOS instead of PC-DOS.

Microsoft is researching this problem and will post new information

here as it becomes available.

The following program, compiled with "cl /W3 /c", demonstrates the

problem:

#include <stdio.h>

#include <dos.h>

void main(void)

{

unsigned size;

unsigned segment;

printf("Checking memory:\n");

size = 0xffff;

if (_dos_allocmem (size, &segment))

printf("Available paragraphs: %u\n",segment);

else

printf("Memory allocated.\n");

}

Additional reference words: 5.10