The magazine of the Melbourne PC User Group

Memories are made of ....
Tom Coleman

This discussion about memory misses as much as it hits. It is not intended to to be a comprehensive dissertation. It is a simplified description of the basic terminology.

Given that caveat, it is fair to say that what follows is about all you need to know until you have to get involved.

To avoid getting too mathematical about it, take it from me that the 8088 chip, the one used in the PC and the XT, can only address 1024 kilobytes of memory.

That's 1 Megabyte. Remember that 1 kB is 1024 not 1000.

Take out your calculator and you will discover t 1024 is 16 times 64. You will have astutely noticed that both 16 and 64 are 2 times 2 times 2 ever many times. That is significant but I will leave you to meditate upon it.

Wisdom comes from understanding the question not from discovering the answer.

For the same obscure reasons this 1024 kB is divided into 16 blocks of 64 kB and numbered from 0 to F. That's how they do things in Hex. I counting in 16s instead of 10s. In order to have single digits instead of 10, 11, 12, 13 ,14 and 1 they substitute A, B, C, D, E and F. 10 in Hex is 16 in English.

Programmers love this kind of hocus pocus. It makes them sound important.

When the early programmers were designing the way DOS would work they decided that they would keep 384 kB of that 1024 for DOS to use for internal housekeeping. The remaining 640 kB would be for the user to run programs in.

Well not quite. There is a little bit of COMMAND.COM that gets loaded into your 640 kB.

What this means is that we get 0 to 9 and they get A to F.

To distinguish between the two, the part set aside for DOS, the blocks A to F, were called the UPPER MEMORY BLOCKS. Remember that because I am going to have a bit more to say about it soon.

Later on Intel turned out the 80286 chip which had an extra 4 address lines in it. So 2 x 2 x 2 x 2 = 16. That means that the 286 chip could address 16 times more memory. 16 Megabytes.

If you don't understand that, try to work it out. If you can't work it out dori't worry. It is only interesting and not vital.

The computing public was getting pretty chewed off with this 640 kB limit and having a chip that could use all kinds of memory was a bit of adding insult to injury.

However while the 286 chip was capable of addressing this gluttonous amount of memory, DOS could not It was written for the dark ages of computing when 1 Megabute was all there was.

It's a bit like asking you to spell the letters above Z. There ain't no such animal. That's how DOS sees it.

Now those cunning Intel chip designers had worked out a way to switch the chip from behaving like a 8088 chip with the 1 Megabyte limit to a state called PROTECTED MODE when it could have a smorgasbord with the 16 Megabytes. However once it switched to protected mode it could not switch back to normal DOS type, 8088 operation, which was called REAL MODE.

I will bet that someone got sacked over that.

The only way to get back to Real Mode from Protected Mode was to reboot the computer. Hardly a satisfactory technique.

Lets take a side track at this point

Before they came out with the 286 chip with its fancy memory addressing capability they had a sort of hardware/software conjuring trick called EXPANDED MEMORY. It worked like this.

With extra memory chips on an add-in board and the right software loaded in CONFIG.SYS you could use the extra memory on the add-in board to store Data. This data was swapped into the Upper Memory Blocks, 16 kB at a time. Now DOS knows all about the Upper Memory and could, with a bit of software help, reach up and retrieve the page of data that had been swapped from the Expanded Memory.

Lots of programs were written before the 286 chip could use Expanded Memory. Lotus for example. Lotus still uses Expanded Memory.

One of the problems with Expanded memory was that you could not run programs in Expanded Memory. You could use it for Ramdisks or Spoolers but you could not run a program.

Meanwhile, back at the ranch, users were looking to a way to access those 16 Megabytes that the 286 chip knew about.

Really what this represented was more memory on top of the 1 Megabyte that the 8088 chip could use. More of the same. An extension of existing memory. It is called EXTENDED MEMORY.

The development of techniques to get at Extended Memory has been going on for some years. Different programs use different approaches. The variety of ways is gradually settling down and some kind of a standard is emerging.

Many of the problems relate to getting back to Real Mode but programmers are getting smarter and now the old 640 kB barrier is more of a nuisance than a real barrier.

I suppose that in a few years from now the 640 kB will become the bootup area and everything will run in Extended memory. There will be no need to access Real Mode. That will be done, transparently by the Operating System if required.

That first Megabyte of memory will become to the Operating System what the 384 kB Upper Memory Blocks are at present. A sort of private playing field where internal housekeeping is done.

Of course someone could write an operating system that does not have these restrictions but runs all DOS programs anyway. It would be a world beater.

Having got this far it is appropriate to look at the real world and look at some of the confusion. First of all there is the name similarity between Expanded and Extended Memory. We can live with that and once you have got used to it then that's the end of the confusion.

Not so the confusion of defining just what is Extended Memory.

Extended memory is the memory above the first Megabyte.

It is NOT the memory above 640 kB. That is the Upper Memory Area.

Some manufactures use the words Extended Memory to mean the Upper Memory Area and they confuse the hell out of everyone.

You see this at bootup when the BIOS check tells you that you have 384 kB of Extended Memory. What rubbish.

This is salesmen using hi-tech words to baffle customers.

There is a grey area that might be regarded as Extended Memory and then again maybe not. This is the High Memory Area.

Here how it comes about Without going into the agonies of memory addresses it is enough to say that memory is addressed in 64 kB blocks.

A memory address can start anywhere and the next 64 kB is the block being addressed. The actual address takes 16 bytes.

So if we use the last 16 bytes of the 1 Megabyte that DOS knows about we can trick DOS into addressing near enough another 64 kB of memory (All but the 16 byte address) above the 1 Megabyte.

This illusion, this sleight of hand, is known as the High memory Area. This is where DOS 5 loads high and where Himem.sys does its thing.

Is the High Memory Area part of Extended Memory or is it part of the Upper Memory Area. A fine philosophical point.

A little Zen goes a long way when dwelling on the mysticism of memory. After all there are answers to which there is no question.

Reprinted from the October 1991 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]