The Full Wiki

Bank switch: Wikis

Advertisements

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

Encyclopedia

(Redirected to Bank switching article)

From Wikipedia, the free encyclopedia

Bank switching (also known as "paging", but only loosely related to the ordinary meaning of "paging" in computing) is a technique that was common in 8-bit microcomputer systems, to increase the amount of addressable RAM and/or ROM above what can directly be addressed by a particular CPUs address bus. It may also be 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. Many modern 8-bit microcontrollers and microprocessors use bank switching to manage read-write memory, non-volatile memory, input-output devices and system management registers in small embedded systems.

Contents

Home computers

The byte addressable processors with 16-bit addressing (Z80, 6502, 6809, etc) commonly used in home computers can directly address only 64 KB; systems with memories larger than 64K therefore had to divide the CPU address space into a number of blocks that could be dynamically mapped into parts of a larger address space. Banks/pages/blocks of various (system dependent) sizes were switched in and out via bank select registers or similar mechanisms; some blocks typically being enabled all the time. Some caution was required in order not to corrupt the handling of calls, interrupts, the machine stack, and so on. Unlike other memory management techniques, bank switching was typically controlled directly by the application program (although CP/M version 3.0 took detailed control of this). While the contents of memory temporarily switched out from the CPU was inaccessible to that processor, it could in many cases be read or modified by other hardware, such as video circuitry, DMA, I/O devices, etc.

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.

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 is a form of bank switching technique that allows more than the 640 KB of RAM foreseen by the original IBM PC architecture, by letting it appear piecewise in a 64 KB "window" located in the Upper Memory Area. The 64 KB is divided into four 16 KB "pages" which can each be independently switched. Some computer games made use of this, and though EMS is obsolete, the feature is nowadays emulated by later Microsoft Windows operating systems to provide backwards compatibility with those programs.

The later eXtended Memory Specification (XMS), also now obsolete, is a standard for, in principle, simulating bank switching for memory above 1 MB (called "extended memory"), which is not directly addressable in the Real Mode of x86 processors in which MS-DOS runs. XMS allows extended memory to be copied anywhere in conventional memory, so the boundaries of the "banks" are not fixed, but in every other way it works like the bank switching of EMS, from the perspective of a program that uses it. Later versions of MS-DOS (starting circa version 5.0) included the EMM386 driver, which simulates EMS memory using XMS, allowing programs to use extended memory even if they were written for EMS. Microsoft Windows emulates XMS also, for those programs that require it.

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 game data such as graphics and different game stages). 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 peripherals as infrared links or rumble motors. Bank switching was still being used on later game 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.

Alternative and successor techniques

Bank switching was later supplanted by segmentation in many 16-bit systems, which in turn gave way to paging memory management units. In embedded systems, however, bank switching is still often used, for its simplicity, low cost, and often better adaptation to those contexts than to general purpose computing.

See also

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

Computers using bank switching

External links

Advertisements

Advertisements






Got something to say? Make a comment.
Your name
Your email address
Message