Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Allocating memory above 1MB in DOS

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
mejia
Asked:
mejia
  • 2
1 Solution
 
imladrisCommented:
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
 
warmcatCommented:
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
 
mejiaAuthor Commented:
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
 
warmcatCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now