Misplaced Pages

Bank switching

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

This is an old revision of this page, as edited by Beno1000 (talk | contribs) at 11:39, 4 July 2009. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Revision as of 11:39, 4 July 2009 by Beno1000 (talk | contribs)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Bank switching" – news · newspapers · books · scholar · JSTOR (May 2009) (Learn how and when to remove this message)

Bank switching (also known as "paging", but only loosely related to the ordinary meaning of "paging" in computing) was a technique common in 8-bit microcomputer systems, to increase the amount of addressable RAM and ROM without extending the address bus. Bank switching was also used to configure a system differently at different times, for example, a ROM required to start a system from diskette could be switched out when no longer needed. Certain modern microcontrollers use bank switching to manage read-write memory, non-volatile memory, input-output devices and system management registers.

Since 8-bit CPUs such as the Zilog Z80 and the MOS Technology 6502 series, with their 16-bit address registers, could only address a maximum of 64 KB of memory (in case of a single address being an 8-bit element, see address bus), 8-bit systems containing more than 64 KB of memory addressed memory in banks (or "pages"). Typically there was some memory that was always mapped into the processor's address space and other parts that could be switched in and out through use of a bank select register. Caution was required when breaking memory into banks so that the processor could always correctly handle interrupts and the processor stack, if any. Unlike other memory management techniques, bank switching was nearly always initiated by the application program explicitly, although some operating systems such as CP/M version 3.0 took detailed control of the bank switching operation out of the application programmer's hands. The contents of memory temporarily bank-switched out of the processors address space was inaccessible to the processor, but may have been used by, for example, video display hardware or disk controllers.

Bank switching allowed extra memory and functions to be added to a computer design without the expense and incompatibility of switching to a processor with a wider address bus. For example, the C64 used bank switching to allow for a full 64KB of RAM and still provide for ROM and memory-mapped I/O as well. The Atari 130XE could allow its two processors (the 6502 and the ANTIC) to access separate RAM banks, allowing programmers on both machines to make large playfields and other graphic objects without using up the memory visible to the CPU.

Bank switching in the IBM PC

In 1988 the companies Lotus, Intel and Microsoft agreed on a specification called Expanded Memory System (EMS, also stated as LIM-EMS) for use in IBM PC compatible computers running MS-DOS. It was a form of bank switching technique that allowed more than the 640 KB of RAM foreseen by the original IBM PC architecture, by letting it appear piecewise in a 64KB "window" located in the Upper Memory Area. Some computer games made use of this, and the feature is nowadays emulated by later Microsoft Windows operating systems to provide backwards compatibility with those programs.

Video game consoles

Bank switching was also utilized in some video game consoles. The Atari 2600, for instance, could only address 4 KB of ROM, so later 2600 game cartridges contained their own bank switching hardware in order to permit the use of more ROM and thus allow for more sophisticated games (via more program code and, equally important, larger amounts of gameworld data such as graphics and sound). The Nintendo Entertainment System contained a modified 6502 but its cartridges sometimes contained a megabit or more of ROM, addressed via bank switching called a Multi-Memory Controller. Game Boy cartridges used a chip called MBC (Memory Bank Controller), which not only offered ROM bank switching, but also cartridge SRAM bank switching, and even access to such features as infrared links or rumble motors. Bank switching was still being used on later games systems. Several Sega Mega Drive cartridges were over 4MB in size and required the use of this technique (4MB being the maximum address size). The GP2X handheld from Gamepark Holdings uses bank switching in order to control the start address (or memory offset) for the second processor.

See also

Sideways address space, an example of bank switching on the BBC Micro

Computers using bank switching

External links

Categories: