Allocating memory above 1MB in DOS

Posted on 1998-09-14
Last Modified: 2008-02-01
I am trying to read two matrixes with 600 times 600 integer elements each one and to subtract them in a C program running under DOS in a computer with 16MB RAM. Is it possible to have the three arrays in RAM simultaneously, running under DOS?
Question by:mejia
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 16

Expert Comment

ID: 1252713
There is no straightforward way of allocating the roughly 720K that would be needed for 3 600 by 600 matrices of integers (2 bytes I assume).

Given your mention of reading, I'm assuming that the two matricies to be subtracted are in fact in files on disk. Doing the subtraction one row at a time, or maybe 10 rows at a time, should not lead to a noticably slower solution.


Accepted Solution

warmcat earned 100 total points
ID: 1252714

There is the old EMS(?) Extende memory manager thing that works through EMM386 via an INT-based API.

Also, using HUGE * will allow you to access them in a reasonably civilized way.  But for this kind of job, 32-bit is your man.  The now slightly stinky Watcom compiler, available cheaply, includes a Dos Extender and allows you to write 32 bit flat code with plain old DOS.  With that, you can literally go:

  int iaOne[300][300], iaTwo[300][300], iaThree[300][300];

and think nothing of it.



Author Comment

ID: 1252715
To warmcat:

Could you be more specific about: "There is the old EMS(?) Extende memory manager thing that works through EMM386 via an INT-based API. " ?


Expert Comment

ID: 1252716

Unfortunately this has been deemed by MS as too old to bother with, and is on neither their MSDN website nor my copy of the full MSDN.  However, hit your local bookstore and you're bound to find something in the remainder bin.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
In C, why can't I shift a 64-bit integer more than 32 bits? 13 279
How to align numbers in C using the %d 2 117
Socket Programming (Unix) 8 157
C Programming - If Statement 8 84
This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question