Memory Mapper
This page was last modified 11:48, 8 October 2018 by Gdx. Based on work by PAC and Msxholder and others.



A "memory mapper" is a general term describing a mechanism to 'map' blocks of memory into specific memory ranges (like what's addressed by a CPU). It can apply to RAM, ROM or some combination of those. Often such a mechanism is used to let a CPU address more memory than it supports natively. Memory mappers are used on many different systems, and come in many different shapes & sizes.

In MSX context, it normally refers to a RAM memory mapper as introduced optionally with the MSX2 standard. Memory mappers are also used in some ROM cartridges, usually these are referred to as a "MegaROM" or "ROM mapper".

Memory Mappers on MSX2 and higher



  • Yamaha S1985 MSX2 engine IC supports a 512 KiB memory mapper. As a result of a shared pin, it depends on the type of keyboard whether maximum supported size is 256 or 512 KiB.
  • Toshiba T9769 MSX2+ engine supports a 512 KiB memory mapper.
  • Daewoo DW64MX1 MSX2 engine supports a 256 KiB memory mapper in slot 0-2.

Usually not the fully supported size is present. Expansion up to the supported size is relatively easy. Expansion to bigger sizes requires adding more electronics (logic IC's).

The Yamaha S3527 MSX engine does not include support for a memory mapper. Some MSX models include a memory mapper built using discrete logic IC's. Often one or more 74LS670 IC's are used as the actual mapper registers.


Maximum size

An MSX memory mapper contains up to 256 (2^8) blocks of 16 KiB (16384 bytes) each. Thus the maximum size for a mapper is 4 MiB (4096 KiB).

I/O ports

Memory Mapper has 4 registers each writable via following I/O ports.

  • Port FCh (252) provides access to the register that indicates the page on bank 0 (0000-3FFFh).
  • Port FDh (253) provides access to the register that indicates the page on bank 1 (4000-7FFFh).
  • Port FEh (254) provides access to the register that indicates the page on bank 2 (8000-BFFFh).
  • Port FFh (255) provides access to the register that indicates the page on bank 3 (C000-FFFFh).

If multiple Memory Mapper are installed on the system, the registers will act on all the Memory Mappers in each slot at the same time.

About reading, only registers of the internal Mapper are meant to be readable but many cartridges implemented the reading because they were originally intended for MSX2 without Memory Mapper. Therefore if multiple Memory Mapper of different sizes are installed the read values will be wrong.


During bootup, the MSX2 bios initializes memory mapper(s) by writing to these I/O ports. Default configuration is as follows:

  • Page 3 is set on bank 0 (0000-3FFFh).
  • Page 2 is set on bank 1 (4000-7FFFh).
  • Page 1 is set on bank 2 (8000-BFFFh).
  • Page 0 is set on bank 3 (C000-FFFFh).

For software that's unaware of the memory mapper concept, the default configuration above appears like a regular 64 KiB block of RAM.

RAM selection

It is possible to select the same RAM block for several memory ranges, in which case these ranges will mirror each other (= visible through different memory ranges, but the same RAM is accessed). It is not possible to select multiple blocks in one 16 KiB memory range at the same time; they can be accessed sequentially by switching the mapper blocks using the I/O ports.

In any case, the memory mapper RAM is only accessible in a 16 KiB 'page' of the Z80's address space, if the memory mapper's slot is selected for that page. So one could consider the memory mapper a mechanism that is layered on top of the MSX (sub)slot mechanism.

Reading back mapper registers

Mapper registers written via I/O ports FC-FFh can usually be read back. A programmer should not rely on this, as the results can be confusing, erroneous, or garbage. Especially if multiple memory mappers are present in a system.

Unfortunately it's not uncommon for software to read the mapper registers. For this reason, most memory mappers support read-back of the mapper registers. But not all: a memory mapper that doesn't support read-back, is simpler to construct & thus quite a few memory mappers were built that way.


  • On some MSX2 (Eg Panasonic FS-A1), you can use a memory mapper without registers readable but the registers will still be readable until 1024kB because these MSX always save written values to registers until 3Fh. Bits 7 and 6 stay to 1 or 0. Anyway the registers will be readable on these MSX even if no Memory Mapper is installed.
  • On MSX2+ and turbo R, reading registers of external Memory Mappers is blocked.

Multiple memory mappers

It is possible to have multiple memory mappers in an MSX (theoretically up to 15, for a maximum of 60 MiB!). This is not a problem, and some software exists that supports using all that RAM. On MSX2+ and Turbo R computers, the total amount of RAM (excluding video RAM) is displayed under the boot logo.

Each memory mapper has its own copy of the mapper registers. But depending on mapper size, each mapper may only store a limited number of bits for each mapper register. When writing to these registers (I/O ports FC-FFh), all memory mappers present will update their copy at the same time. For example if there are 3 memory mappers present, there will be 3 copies of the mapper registers which are updated simultaneously. When reading back a mapper register in such a configuration, the result may come from the biggest mapper. Or from a built-in mapper. Or in some cases, correspond to a 'floating data bus'. Or some mix thereof. Therefore (as stated above) results are unreliable and programmers should not (ever!) read the mapper registers.

Memory Mappers on MSX1

The BIOS in MSX1 computers doesn't initialize memory mappers. At power up, most memory mappers will have block 0 selected for each of the 4 memory pages, and be recognised as a 16 KiB block of RAM that's mirrored in all pages. There are several solutions to this:

  • Initialization can be performed by hand, followed by a reset (NOT a power cycle!).
  • Some CPLD- or FPGA-based memory mappers do support starting in an MSX-standard configuration (either on power-up, or using hardware /RESET signal).
  • In theory an MSX1 bios ROM could be altered to do mapper initialization like on MSX2 and above.
  • Some cartridges meant to be used on MSX1, may include code to initialize memory mappers.
  • The Yamaha CX5MII is the exception.

Software support

In most cases, it's problematic (or at least difficult) to have multiple pieces of software share the RAM in an MSX. Memory mappers are no exception to this rule. Following software exists to make this easier:

  • MemMan: this is loaded separately from disk, before running software that uses it.
  • MSX-DOS2: its memory mapper support (residing in ROM) includes routines that enables multiple application software to use the same memory mapper(s) without overwriting each others' RAM.

Also a few MSX1 machines and all MSX2 and higher machines have MSX-BASIC support for RAM disk of up to ~216 KiB (see CALL MEMINI). This built-in RAM disk is not aware of MemMan or MSX-DOS2 mapper support, so this RAM disk should not be used in combination with MemMan or MSX-DOS2.