News:

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

64K memory limitation in real mode

Started by carlottagp, July 24, 2011, 05:35:35 PM

Previous topic - Next topic

carlottagp

I would like to share my simple solution to the 64K memory limitation in
16-bit programs.  I needed a large two-word array for storing prime numbers.

My solution was to define a file, starting with a small number of primes,
and use the int 21h - 42h function to move the file pointer around;
back to the beginning for a new search, and defining a new line number
for each new prime. I needed only a million primes, so I stopped at
00FFFFFD (16,777,213). There are actually 1,077,873 primes in the file,
and the file size is approximately 11 Mbytes. The final five primes in the
file are shown here:

00FFFFB5
00FFFFC1
00FFFFDF
00FFFFEF
00FFFFFD

Of course, one could manage any number of large files in this way. Perhaps
someone else will find this approach useful.

Mike

omarromero

Does it really work? Is this your invention?

xandaz

   you could also use several segments no?

FORTRANS

Hi,

   Yes, you can use more than one segment.  You can design
your data so that it uses 16 byte aligned elements and then
calculate the segment register value for each access, rather than
incrementing a base or index register.  But neither practice will
let you work with datasets larger than the less than one
megabyte available.  For one of the programming puzzles here
I need to sort that required a bit over eight megabytes.  I used
external files to hold the data and used file reads and writes to
access the data.  Since the sort accessed the data in a serial
fashion, I did not need to use the move file pointer function.

Regards,

Steve N.

clive

omarromero is a bot, or a stooge, generating link traffic.
carlottagp doesn't really understand segmentation or 16-bit programming, and about 30 years too late for it to matter.
It could be a random act of randomness. Those happen a lot as well.