Solved

Allocating memory above 1MB in DOS

Posted on 1998-09-14
4
257 Views
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?
0
Comment
Question by:mejia
  • 2
4 Comments
 
LVL 16

Expert Comment

by:imladris
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.

0
 
LVL 2

Accepted Solution

by:
warmcat earned 100 total points
ID: 1252714
Mejia-darling,

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.

Regards,

-Andy
0
 

Author Comment

by:mejia
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. " ?

Thanks
0
 
LVL 2

Expert Comment

by:warmcat
ID: 1252716
mejia,

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.

-Andy
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now