http://map.grauw.nl/resources/msx_io_ports.php#mmapper

The Z80 used in the MSX has 64k of addressable memory. To be able to use more memory, memory mappers are used in MSX2 computers and above. A memory mapper divides the 64k of RAM into four 16k blocks called pages, into which up to 256 different memory segments can be mapped. Note that these segments are shared – it is possible to map a segment used in page 0 into page 1 as well.

Port range	Description
#FC (write)	Mapper segment for page 0 (#0000-#3FFF)
#FD (write)	Mapper segment for page 1 (#4000-#7FFF)
#FE (write)	Mapper segment for page 2 (#8000-#BFFF)
#FF (write)	Mapper segment for page 3 (#C000-#FFFF)
Note that reading those registers is not reliable, and should not be done.

Detecting the amount of available memory can be done by writing a unique value into all mapper pages and iterating through them until you see repetition. If the repetition e.g. occurs after 8 pages, there is 128k of RAM available. Usually, you will want to do this with interrupts disabled and also want to restore the original values.

Note about DOS2: MSX-DOS2 provides a set of convenient memory management routines. In a DOS2 environment, you should not access the mapper registers directly, as this will cause various problems. The routines DOS2 offers are very fast, and there should be no reason not to use them.
