This topic describes the Extended Memory Specification, which provides a
way for applications and operating systems to access Extended  Memory on
286+ CPUs, without the complications of running in protected mode.  XMS
also describes how to access the HMA  (though it is nearly always best to
let MS-DOS use the HMA).

See XMS Functions for descriptions of services.

XMS is an industry standard proposed jointly by Microsoft, Lotus, Intel,
and AST.  The version 2.0 spec has been in effect since 1992.

Virtually every AT-class or better computer has some XMS memory and nearly
all users install the device driver that enables access to XMS.

Note: Extended Memory is not available on pre-AT (8088-based) PCs.
However, some of these older machines are equipped with LIM-EMS
boards.  The Expanded Memory Specification (EMS) offers access to
additional memory on such computers.

  Determining if XMS is Installed  
XMS memory is managed by an installable device driver.  The one that
comes with MS-DOS is named HIMEM.SYS, but other names may be used by
other vendors.

When the driver is installed, it hooks INT 2fH, and watches for calls in
which AH=43H.  Use INT 2fH 4300H (get installed state) to see if its
support is available.

  Accessing XMS Services  
Use INT 2fH 4310H (get XMS entry address) to learn the address at which
the XMS service dispatcher resides.

Load AH with a service number (and other registers as needed), and use a
FAR CALL to call the entry address.  Check AX upon return.  If AX=0, then
the request succeeded; otherwise and XMS error code is returned in BL.
See INT 2fH 4310H for an example.

See XMS Functions for parameters required for each service.

  DOS Support  
Starting with version 5.0, DOS comes with an XMS support driver
(HIMEM.SYS) for 286-based and better computers.  A few DOS device
drivers and TSRs will take advantage of XMS if it is present:

  DOS 5.0+ loads most of COMMAND.COM into the HMA , and places disk I/O
buffers there and otherwise makes good use of the area.

  DOS 5.0+ RAMDISK.SYS can use XMS (DEVICE=RAMDISK.SYS nnn /E).

  DOS 5.x SMARTDRV.EXE disk cache will use XMS automatically (unless /A
is used to specify EMS ).  The DOS 6.0 cache can use XMS ONLY.

  DOS 6.0 programs and TSRs: Defrag, Dosshell, Msbackup, Mscdex, and
Vsafe use XMS memory when it is available.

  DOS 6.2 DoubleSpace support will place part of itself into the HMA 
when BUFFERS= is small.


  What about UMBs?  
Although the XMS describes two fns for accessing UMBs , it does not supply
the upper memory; that is, it appears to be able to track areas of memory
that happen to exist between 640K and 1MB, but most computers don't have
any available memory there.

Support for the DEVICEHIGH= and Loadhigh commands is supplied only on 386+
CPUs by the MS-DOS device driver Emm386.Exe (or other compatible system
software such as 386Max, or NetRoom, etc.)

The memory that is mapped into the upper memory blocks is subtracted from
the pool above 1 MB, so an XMS provider (such as HIMEM.SYS) must be
present for UMB support to be present.

See Accessing Upper Memory for related info.

See Also: XMS Functions
- -

Extended Memory Specification (XMS)