# Extended memory

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Extended_memory
> Markdown URL: https://mediated.wiki/source/Extended_memory.md
> Source: https://en.wikipedia.org/wiki/Extended_memory
> Source revision: 1351409451
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Section of computer memory in PC compatibles

Extended memory is located above 1 MB, includes the [high memory area](/source/High_memory_area), and ends at 16 MB on the [Intel 286](/source/Intel_286) and at 4 GB on the [Intel 386DX](/source/Intel_386) and later.

In [DOS memory management](/source/DOS_memory_management), **extended memory** refers to [memory](/source/Computer_memory) above the first [megabyte](/source/Megabyte) (220 bytes) of [address space](/source/Address_space) in an [IBM PC](/source/IBM_PC) or compatible with an [80286](/source/80286) or later [processor](/source/Central_processing_unit). The term is mainly used under the [DOS](/source/DOS) and [Windows](/source/Windows) [operating systems](/source/Operating_system). DOS programs, running in [real mode](/source/Real_mode) or [virtual x86 mode](/source/Virtual_x86_mode), cannot directly access this memory, but are able to do so through an [application programming interface](/source/Application_programming_interface) (API) called the *[Extended Memory Specification](#XMS)* (XMS). This API is implemented by a [driver](/source/Device_driver) (such as [HIMEM.SYS](/source/HIMEM.SYS)) or the operating system kernel, which takes care of [memory management](/source/Memory_management) and copying memory between [conventional](/source/Conventional_memory) and extended memory, by temporarily switching the processor into [protected mode](/source/Protected_mode). In this context, the term "extended memory" may refer to either the whole of the extended memory or only the portion available through this API.

Extended memory can also be accessed directly by DOS programs running in protected mode using [VCPI](/source/VCPI) or [DPMI](/source/DOS_Protected_Mode_Interface), two (different and incompatible) methods of using protected mode under DOS.

Extended memory should not be confused with [expanded memory](/source/Expanded_memory) (EMS), an earlier method for expanding the IBM PC's memory capacity beyond 640 kB (655,360 bytes) using an [expansion card](/source/Expansion_card) with [bank switched](/source/Bank_switching) memory modules. Because of the available support for expanded memory in popular applications, device drivers were developed that emulated expanded memory using extended memory. Later two additional methods were developed allowing direct access to small portions of additional memory above 640 KB from real mode. One of these is referred to as the [high memory area](/source/High_memory_area) (HMA), consisting of the first nearly 64 KB of extended memory, and the other is referred to as the [upper memory area](/source/Upper_memory_area) (UMA; also referred to as upper memory blocks or UMBs), located in the address range between 640 KB and 1 MB which the IBM PC designates for hardware adapters and ROM.

## Overview

On [x86](/source/X86)-based PCs, extended memory is only available with an [Intel 80286](/source/Intel_80286) processor or higher, such as the [IBM PC AT](/source/IBM_PC_AT).[1] Only these chips can directly address more than 1 megabyte of [RAM](/source/RAM). The earlier [8086](/source/8086)/[8088](/source/8088) processors can make use of more than 1 MB of RAM if one employs [special hardware](/source/Bank_switching) to make selectable parts of it appear at addresses below 1 MB.

On a 286 or better PC equipped with more than 640 kB of RAM, the additional memory would generally be re-mapped above the 1 MB boundary, since the IBM PC architecture reserves addresses between 640 kB and 1 MB for system ROM and peripherals.

Extended memory is not accessible in [real mode](/source/Real_mode) (except for a small portion called the [high memory area](/source/High_memory_area)). Only applications executing in [protected mode](/source/Protected_mode) can use extended memory directly. A supervising protected-mode [operating system](/source/Operating_system) such as [Microsoft Windows](/source/Microsoft_Windows) manages application programs' access to memory. The processor makes this memory available through the [Global Descriptor Table](/source/Global_Descriptor_Table) (GDT) and one or more [Local Descriptor Tables](/source/Local_Descriptor_Table) (LDTs). The memory is "protected" in the sense that memory segments assigned a local descriptor cannot be accessed by another program because that program uses a different LDT, and memory segments assigned a global descriptor can have their access rights restricted, causing a processor [exception](/source/Exception_handling) (e.g., a [general protection fault](/source/General_protection_fault) or GPF) on violation. This prevents programs running in protected mode from interfering with each other's memory.[2]

Extended memory went unused at first because no software ran in the 80286's protected mode. By contrast, the industry quickly adopted 1985's [expanded memory](/source/Expanded_memory) standard, which works with all PCs regardless of processor.[1] A protected-mode operating system such as Microsoft Windows can also run real-mode programs and provide expanded memory to them. The [DOS Protected Mode Interface](/source/DOS_Protected_Mode_Interface) (DPMI) is Microsoft's prescribed method for a [DOS](/source/DOS) program to access extended memory under a [multitasking](/source/Computer_multitasking) environment.[2]

## *Extended Memory Specification* (XMS)

The ***Extended Memory Specification*** (**XMS**) is the specification describing the use of [IBM PC](/source/IBM_PC) extended memory in [real mode](/source/Real_mode) for storing data (but not for running executable code in it). Memory is made available by **extended memory manager** (**XMM**) software such as [HIMEM.SYS](/source/HIMEM.SYS). The XMM functions are accessible by direct calls to a variable address that can be found through [software interrupt](/source/Software_interrupt) 2Fh function 4310h.

XMS version 2.0, released in July 1988, allowed for up to 64 MB of memory.[3] With XMS version 3.0 this increased to 4 GB (232 bytes).[4] The difference is a direct result of the sizes of the values used to report the amounts of total and unallocated (free) extended memory in 1 KB (1024-byte) units: XMS 2.0 uses 16-bit unsigned integers, capable of representing a maximum of (65535 * 1 KB) = 64 MB, while XMS 3.0 adds new alternate functions that use 32-bit unsigned integers, capable of representing (4 G * 1 KB) = 4 TB (4 terabytes) but limited by the specification to 4 GB.[3][4] (4 GB is the address range of the 80386 and the 80486, the only 32-bit Intel x86 CPUs that existed when XMS 3.0 was published in 1991.) XMS 3.0 retains the original XMS 2.0 API functions with their original 64 MB limit but adds new "super extended memory" functions that support 4 GB of extended memory (minus the first 1 MB) and can be called only with a 32-bit CPU (since these "super" functions use 32-bit CPU registers to pass values).[4] To differentiate between the possibly different amount of memory that might be available to applications, depending on which version of the specification they were developed to, the latter may be referred to as **super extended memory** (**SXMS**).

The extended memory manager is also responsible for managing allocations in the [high memory area](/source/High_memory_area) (HMA) and the [upper memory area](/source/Upper_memory_area) (UMA; also referred to as upper memory blocks or UMBs). In practice the upper memory area will be provided by the [expanded memory](/source/Expanded_memory) manager (EMM), after which DOS will try to allocate them all and manage them itself.[*[clarification needed](https://en.wikipedia.org/wiki/Wikipedia:Please_clarify)*][*[citation needed](https://en.wikipedia.org/wiki/Wikipedia:Citation_needed)*]

## See also

- [DOS memory management](/source/DOS_memory_management)

- [Conventional memory](/source/Conventional_memory)

- [Expanded memory](/source/Expanded_memory) (EMS)

- [High memory area](/source/High_memory_area) (HMA)

- [Upper memory area](/source/Upper_memory_area) (UMA)

- [Global EMM Import Specification](/source/Global_EMM_Import_Specification) (GEMMIS)

- [Unreal mode](/source/Unreal_mode)

## References

**Specifications**

1. ^ [***a***](#cite_ref-Mendelson_1989_1-0) [***b***](#cite_ref-Mendelson_1989_1-1) [Mendelson, Edward](/source/Edward_Mendelson) (1989-12-12). ["A Slot Full of RAM"](https://books.google.com/books?id=5CmkZ3THZtwC&pg=PT170). *[PC Magazine](/source/PC_Magazine)*. Vol. 8, no. 21. [Ziff Davis Publishing Co.](/source/Ziff_Davis_Publishing_Co.) pp. 169–. [Archived](https://web.archive.org/web/20200208221014/https://books.google.de/books?id=5CmkZ3THZtwC&lpg=PT171&pg=PT170&redir_esc=y) from the original on 2020-02-08. Retrieved 2020-02-08.

1. ^ [***a***](#cite_ref-FOLDOC_2-0) [***b***](#cite_ref-FOLDOC_2-1) This article is based on material taken from [extended+memory](https://foldoc.org/extended+memory) at the *[Free On-line Dictionary of Computing](/source/Free_On-line_Dictionary_of_Computing)* prior to 1 November 2008 and incorporated under the "relicensing" terms of the [GFDL](/source/GNU_Free_Documentation_License), version 1.3 or later.

1. ^ [***a***](#cite_ref-XMS2_3-0) [***b***](#cite_ref-XMS2_3-1) [Microsoft](/source/Microsoft), [Lotus](/source/Lotus_Development), [Intel](/source/Intel), and [AST Research](/source/AST_Research) (1988-07-19). [*eXtended Memory Specification (XMS), version 2.0*](http://www.phatcode.net/res/219/files/xms20.txt)

1. ^ [***a***](#cite_ref-XMS3_4-0) [***b***](#cite_ref-XMS3_4-1) [***c***](#cite_ref-XMS3_4-2) Microsoft, Lotus, Intel, and AST Research (January 1991). [*eXtended Memory Specification (XMS), version 3.0*](http://www.phatcode.net/res/219/files/xms30.txt)

**Microsoft Knowledge Base**

- [*A General Tutorial on the Various Forms of Memory*](https://jeffpar.github.io/kbarchive/kb/037/Q37242/)

- [*Overview of Memory-Management Functionality in MS-DOS*](https://jeffpar.github.io/kbarchive/kb/095/Q95555/)

- [*Microsoft Diagnostic Utility: Definition of SXMS*](https://jeffpar.github.io/kbarchive/kb/121/Q121008/)

## External links

- [Extended Memory (XMS) Specification](http://www.phatcode.net/articles.php?id=219)

---
Adapted from the Wikipedia article [Extended memory](https://en.wikipedia.org/wiki/Extended_memory) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Extended_memory?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
