Guide · Updated October 8, 2026 · 7 min read
The DOS memory map, explained
Every DOS game that ever said "not enough memory" with a gigabyte of RAM in the box was fighting the same map. Once you know where the lines are drawn, CONFIG.SYS stops being a spell book and becomes arithmetic.
How we pick. A product makes the list only when reviewers and long-time collectors keep recommending it, it does one job well and it will still work in five years. No filler, no mystery brands, and no paid placements. Not every item has been through our own bench, so we go by reputation. Prices change, so check the listing.
Some links on this page are affiliate links. If you buy through one, Conventional Memory earns a small commission at no cost to you. Affiliate links. As an Amazon Associate I earn from qualifying purchases. Disclosure
Why 640K? It is just an address bus
The Intel 8088 in the first IBM PC had 20 address lines. Twenty lines can name 2 to the power of 20 bytes, which is 1,048,576 bytes, or 1 MB. That whole range is the machine's address space, and everything has to fit inside it: RAM, video memory, the BIOS and the ROMs on expansion cards.
IBM split the 1 MB in two. The lower 640 KB (addresses 00000h to 9FFFFh) was set aside for RAM, which in 1981 felt like a ridiculous amount when the base PC shipped with 16 KB. The upper 384 KB (A0000h to FFFFFh) was reserved for hardware. That split is the "640K barrier". It is not a rule of DOS, it is a rule of the original PC's memory map, and DOS inherited it.
Addresses on these chips are written as segment:offset, two 16-bit numbers. The CPU shifts the segment left four bits and adds the offset, so B800:0000 is physical address B8000h. Different pairs can name the same byte, which is why you will see C000:0000 and BC00:4000 mean the same place.
The map from 00000 to FFFFF
This is the layout of a typical VGA PC. Exact ranges inside the upper memory area vary by video card and options.
| Range (hex) | Size | What lives there |
|---|---|---|
| 00000 to 003FF | 1 KB | Interrupt vector table (256 four-byte pointers) |
| 00400 to 004FF | 256 bytes | BIOS data area |
| 00500 to 9FFFF | about 638 KB | Conventional memory: DOS, drivers, TSRs and your program |
| A0000 to AFFFF | 64 KB | EGA and VGA graphics memory. Mode 13h draws here |
| B0000 to B7FFF | 32 KB | Monochrome text memory (MDA and Hercules) |
| B8000 to BFFFF | 32 KB | Colour text memory (CGA, EGA, VGA text modes) |
| C0000 to C7FFF | 32 KB | Video card BIOS ROM |
| C8000 to EFFFF | 160 KB | Free for option ROMs, EMS page frame and upper memory blocks |
| F0000 to FFFFF | 64 KB | System BIOS ROM |
Anything in the upper block that is not claimed by a ROM or a card can be borrowed for RAM, but only on a 386 or better, and only if a memory manager such as EMM386 remaps it. On an 8088 or 286 those addresses simply sit empty.
The five kinds of memory
Most of the confusion comes from five words that sound alike. They describe where the memory sits and how a program reaches it.
| Type | Where | Needs | What it is for |
|---|---|---|---|
| Conventional | 0 to 640 KB | Any PC | The only memory plain DOS programs can use directly. Drivers, TSRs and the program itself all compete for it |
| Upper memory (UMA, UMBs) | 640 KB to 1 MB | 386 and EMM386, or a 386 memory manager | Free gaps in the reserved area, turned into blocks where drivers and TSRs can be loaded out of the way |
| High memory area (HMA) | First 64 KB minus 16 bytes above 1 MB | 80286 or better, HIMEM.SYS, A20 gate | Room for most of DOS itself when you write DOS=HIGH. About 65,520 bytes |
| Extended (XMS) | Above 1 MB | 286 or better, HIMEM.SYS | Storage for programs that know the XMS interface, such as RAM disks, caches, Windows 3.x and DOS extenders |
| Expanded (EMS) | Bank-switched through a 64 KB page frame in the upper area | An EMS board, or EMM386 on a 386 | Older games and spreadsheets that wanted more than 640K before extended memory was common |
The A20 trick that created the HMA
Real mode segment:offset math can produce addresses just past 1 MB. FFFF:0010 through FFFF:FFFF reaches 65,520 bytes above the 1 MB line. The 8088 had no 21st address line, so those addresses wrapped around to the bottom of memory, and some programs relied on that wrap.
The 286 does have a 21st line (A20), so IBM added a gate in the keyboard controller to keep it off for compatibility. HIMEM.SYS switches that gate on, which makes the 64 KB just above 1 MB reachable from real mode. That sliver is the high memory area, and DOS=HIGH moves the bulk of the DOS kernel into it, freeing tens of kilobytes of conventional memory.
This is also why a flaky keyboard controller can produce the error "Unable to control A20 line" when HIMEM.SYS loads. HIMEM.SYS has /MACHINE: switches that tell it how to flip A20 on odd hardware.
EMS and XMS are different doors into the same RAM
Extended memory (XMS) is simply RAM at addresses above 1 MB. A driver such as HIMEM.SYS hands out blocks of it on request, and a program copies data in and out.
Expanded memory (EMS) works differently. A 64 KB window in the upper memory area, the page frame, is split into four 16 KB pages. The program asks the Expanded Memory Manager to map any 16 KB page of a much larger pool into one of those four slots. Original EMS boards did this in hardware, and the specification (LIM EMS 3.2 and later 4.0) let programs use up to 32 MB.
On a 386, EMM386.EXE can fake EMS out of extended memory. That is why games from the late 1980s still ask for it, and why many CONFIG.SYS files carry two flavours of the same line: one with RAM, which provides both UMBs and EMS, and one with NOEMS, which provides UMBs only and leaves a little more room.
Reading MEM /C /P
The DOS command that tells you the truth is MEM, run with /C (classify programs) and /P (pause per page). It lists every program in memory, how much conventional and upper memory each uses, and a summary at the bottom.
C:\>MEM /C /P
Modules using memory below 1 MB:
Name Total = Conventional + Upper Memory
-------- ---------------- ---------------- ----------------
MSDOS 16,477 (16K) 16,477 (16K) 0 (0K)
HIMEM 1,168 (1K) 1,168 (1K) 0 (0K)
EMM386 3,120 (3K) 3,120 (3K) 0 (0K)
COMMAND 2,912 (3K) 2,912 (3K) 0 (0K)
MOUSE 10,224 (10K) 0 (0K) 10,224 (10K)
Free 611,456 (597K) 611,456 (597K) ...The numbers that matter are the two at the bottom. "Largest executable program size" is the biggest single program you can run right now. "Largest free upper memory block" tells you whether the next driver you load high will fit. The example above is illustrative, so expect different values on your machine and a different DOS version.
Which version of DOS can do what
| Version | What it added for memory |
|---|---|
| DOS 1.0 to 3.x | Conventional only. Third-party EMS boards and drivers for extended memory |
| DOS 4.0 (1988) | Early support for large disks and EMS drivers. Notorious for using a lot of conventional memory |
| DOS 5.0 (1991) | Built-in HIMEM.SYS and EMM386.EXE, DOS=HIGH,UMB, DEVICEHIGH and LOADHIGH. The point where most people stopped buying memory managers |
| DOS 6.0 and 6.2x (1993 to 1994) | MemMaker automates the tuning, MEM /C improves, multiple boot configurations in CONFIG.SYS |
| PC DOS 7 (1995) | Similar tools, plus REXX and other IBM additions. Same map underneath |
| Windows 95 and 98 | Boot to a built-in MS-DOS 7. HIMEM is loaded for you, but EMM386 and the settings are your job again if you need a game boot disk |
Two third-party memory managers were popular enough to still turn up in game readmes. QEMM from Quarterdeck and 386MAX from Qualitas squeezed out a few more kilobytes than the built-in tools, and they can still be found in old software collections.
Read more and test on real hardware
The memory map makes more sense once you have read the books that defined it and have a real machine to try it on.
Upgrading and Repairing PCs (Scott Mueller)
Book
The reference for the PC-compatible era, with the memory map, chipsets and buses explained clearly. Older editions suit vintage machines best and are cheap used.
The Indispensable PC Hardware Book (Hans-Peter Messmer)
Book
Dense, accurate detail on how the PC address space, interrupts and buses really work. A reference you keep reaching for.
A DOS-era PC to try it on
Hardware
Nothing teaches memory managers like a 386 or 486 with a few megabytes and a pile of drivers fighting for the upper memory area.
Skip these
- Buying RAM to fix a conventional memory error. Extra memory goes above the line, not inside it.
- Running EMM386 on an 8088 or a 286. It needs a 386 or better and will refuse.
- Loading both RAM and NOEMS options at once. Pick one.
Questions people ask
What is the 640K barrier?
It is the limit on conventional memory in a real mode DOS PC. The 8088 can address 1 MB, IBM reserved the top 384 KB for video memory and ROMs, and that left 640 KB for programs.
What is the difference between expanded and extended memory?
Extended memory is plain RAM above 1 MB that a driver hands out in blocks. Expanded memory is a bank-switching scheme that shows 16 KB pages of a larger pool through a 64 KB window in the upper memory area. EMM386 can turn extended into expanded on a 386.
How many kilobytes of conventional memory should I have free?
For most DOS games, 580 KB or more is comfortable, and some demanding titles ask for 600 KB. A clean boot with DOS in the HMA, drivers loaded high and no extras can reach around 620 KB.
What does DOS=HIGH,UMB do?
DOS=HIGH moves most of the DOS kernel into the high memory area, which needs HIMEM.SYS. UMB lets DOS manage upper memory blocks so DEVICEHIGH and LOADHIGH can use them, which needs EMM386.EXE with RAM or NOEMS.
Why does my game want EMS if I have plenty of extended memory?
Because it was written for the older expanded standard. Load EMM386 with the RAM option, and give it a frame address if the game needs one.
Sources
From the timeline
- IBM PC (5150) 1981
- Intel 8088 1979
- IBM PC/AT 1984
- Intel 80386 1985
- MS-DOS 5.0 1991
- MS-DOS 6.22 1994
Read next
- CONFIG.SYS and AUTOEXEC.BAT: free up conventional memoryA working MS-DOS 6 CONFIG.SYS and AUTOEXEC.BAT with HIMEM, EMM386, DOS=HIGH,UMB, DEVICEHIGH, LOADHIGH and a multi-config boot menu, plus fixes for the common errors.
- IRQ, DMA and I/O address cheat sheet for ISA PCsStandard IRQ, DMA channel and I/O port assignments for 286, 386 and 486 PCs, common sound card, modem and network defaults, and how to untangle a hardware conflict.
- IDE hard drive size limits explainedWhy old PCs reject big drives. The CHS and LBA math behind the 504 MB, 2 GB, 8.4 GB and 137 GB limits, BIOS translation modes, FAT16 cluster sizes and how to fit a CompactFlash card.
More to explore
- Retro PC starter kit: the gear worth buying
- How to fix a dead vintage computer
- How to play old PC games today
- Buying a vintage computer: what to check before you pay
- How to connect retro consoles to a modern TV
- How to run DOS games on Windows, Mac and Linux
- BIOS beep codes for vintage PCs
- Floppy disk sizes and capacities explained
- How to replace a dead CMOS battery in a vintage PC
- Yellowed retro plastic: what works and what to skip
- How to store vintage computers and games
- Serial and parallel port pinouts and null modem cables
- Hayes modem AT commands cheat sheet
- CGA, EGA and VGA video modes and monitor pinouts
- Sound Blaster IRQ, DMA and the BLASTER variable
- MS-DOS version history, from 1.0 to 8.0
- Intel PC processors, from 8088 to Pentium 4
- Game console release dates in Japan, North America and Europe
- How to make a DOS boot floppy disk
- Best soldering station for vintage computer repair
- Best multimeter for retro electronics and vintage computer repair
- Replace a dying hard drive in a retro PC
- Gotek vs USB floppy drive vs Greaseweazle
- The retro bench kit
- How to buy a vintage computer on eBay without getting burned
- RetroTINK vs OSSC vs Framemeister: which retro scaler to buy
- Best capacitor kits and tools for recapping retro computers
- How to clean and test retro game cartridges
- Best sound card and MIDI setup for DOS games
- Game Boy IPS screen and battery upgrades: what to buy
- The holiday gift guide for retro fans
- The retro computing glossary
- The Bookshelf: books on computer and game history