
                    Expanded and Extended Memory

        Memory Expansion in an 80286/80386 MS-DOS Environement

                Copyright (C) 1989 by Gary M. Gibson
                        All rights reserved



Systems using 80286 or 80386 microprocessors have two ways to increase
main memory in an MS-DOS environment: "Expanded" memory and "Extended"
memory. The following is a brief discussion of the differences between
them.  It is written primarily from an 80286 perspective, with the 80386
mentioned whenever appropriate.

An 80286 or 80386 running MS-DOS has a 1Mb addressing limit. Within that
1Mb space you have the normal 640Kb program memory, video memory (up to
128Kb), system / EGA / VGA / hard-disk ROM (around 128Kb) and one or
more addressable areas that aren't used for anything (they have no
memory assigned to them.)

Basic ExPANded memory grabs a contiguous 64Kb chunk of that unused
memory address space (below 1Mb) and divides it up into four, 16Kb
"pages." It then allows a program to treat these pages as windows into a
much larger chunk of memory (up to 32Mb.) The larger memory area is
always there and can hold data, but a program can only "window" the data
64Kb at a time. Larger data chunks are addressed by moving the windows
around. I remember exPANded memory because it's not any TALLER (in
terms of addressing more than 1Mb), but it is FATTER (has a "spare tire"
around its middle). This type of memory was standardized by Lotus,
Intel, and Microsoft a few years ago and has come to be known as the LIM
3.2 standard (or EMS 3.2, EMS standing for "Expanded Memory Standard").

Shortly after the LIM brothers came out with EMS 3.2, Ashton-Tate,
QuadRam, and AST developed an Enhanced EMS (EEMS) which added extra
hardware and the ability to have expanded memory "windows" anywhere
within the basic 1Mb address space. This facility was used by DESQview,
for example, to do efficient multitasking even on an 8088.

A year or so later, the LIM brothers convinced everyone else to merge
their expanded memory specs into one that included EMS 3.2 as a subset
and provided EEMS capabilities. This is called the EMS 4.0
specification. If you're really curious, you can get a very nice (thick)
manual on it for FREE by calling Intel and asking for "EMS 4.0".

By now, most programs that need more than the base 640Kb can use
expanded memory, usually limiting themselves to the EMS 3.2 subset of
features. Almost all spreadsheet programs can use expanded memory,
as can some word processors. WordStar 5.0 and 5.5, however, do not use
Expanded memory.

ExTENded memory (TALLER, not FATTER) arrived with the 80286 which,
unlike the 8086/8088, has the physical ability to address 16Mb of memory
directly. Great stuff, right? Wrong. An 80286 can only access this
memory when it is running in what is called "protected mode", and MS-DOS
doesn't use it. In MS-DOS (or native) mode, an 80286 can address only
the basic 1Mb that the 8086/88 can. It takes special code to get into
protected mode (OS/2 runs in that, which is why it can run programs in
all that memory).

Not to be outdone, Microsoft and IBM figured out a way to use exTENded
memory back with DOS 3.0 (when the AT appeared). The first program to
use it was VDISK, the RAMdisk routine distributed as a part of IBM's
DOS.  This allowed you to use up to 15Mb of exTENded memory (if you had
that much) as a RAMdisk from a DOS program by switching into and out of
protected mode. Alas, on an 80286 this is NOT an easy task. Getting from
native (8088) mode into protected mode is easy; getting back again is
not. Intel kinda forgot to give the 80286 a fast way to do that. As a
result, while exTENded memory on an 80286 is fast enough for a RamDisk,
it is NOT fast enough to use it like you can use exPANded memory.

As an aside, this is NOT true on an 80386, where it is easy to switch
back and forth, and hardware support exists to treat exTENded memory
like exPANded memory. This technique is used by 80386 EMS managers like
Qualitas' 386-to-the-Max and Quarterdeck's QEMM.

There is a standard for exTENded memory, though. The LIM brothers were
joined by AST in what is called the "eXtended Memory Standard." XMS 2.0
and documentation is available from Microsoft for the asking (FREE).
This standard is less than a year old, and only a few programs take
advantage of it (MicroSoft's Windows and WSEX are two examples of
programs that can.)

Incidentally, WSEX can use either exPANded (EMS) or exTENded (XMS)
memory if it needs it.

Now to the specifics on how to get more memory for an 80286. Based on
the above, I hope you can see why I recommend an exPANded memory board
which supports the EMS 4.0 standard.  There are quite a number of boards
available from different vendors.  On an 80386 system, exTENded memory
should be added as the hardware makes it easy to treat exTENded memory
as exPANded memory.

One vendor I would recommend without hesitation is Intel. Their Above
Board products support EMS 4.0 memory (well, you'd kinda figure on
that), and they have several plusses. First, their products have a FIVE
YEAR warranty; a memory failure in that period and Intel ships you a
whole new board! Secondly, they are friendly, helpful, and AVAILABLE.
They have a 24-hour free BBS in California for questions
(1-503-645-6275), and they have their own CompuServe forum (GO INTEL or
GO PCEO).  I've bought a lot of equipment from Intel and never had a speck
of trouble with any of it.

Other vendors (e.g. AST) also produce EMS 4.0 conforming exPANded memory
boards.  As long as the board is from a "name" vendor, it should work
well.  Often, the only functional difference is price. A little
comparison shopping could save you a lot of money.

