- Bank switching
Bank switching (also known as "paging", but only loosely related to the ordinary meaning of "
paging " in computing) was a technique common in8-bit microcomputer systems, to increase the amount of addressable RAM and ROM without extending theaddress 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 modernmicrocontroller s 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 theMOS Technology 6502 series, with their16-bit address registers, could only address a maximum of 64 KB of memory (in case of a single address being an 8-bit element, seeaddress 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 processors 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 handleinterrupt s and the processorstack , if any. Unlike other memory management techniques, bank switching was nearly always initiated by the application program explicitly, although some operating systems such asCP/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.While bank switching was less efficient than switching to a processor with a wider address bus would have been, it was an inexpensive way to increase the shelf life of several computer lines of the 1980s and it provided a high degree of backward compatibility with earlier systems: for example, the Apple IIe, IIc (see
Apple II series ), andApple III could run software written for the Apple II+, and theCommodore 128 could run practically all of the software written for its much more prevalent predecessor, the C64 (which had already employed bank switching to allow for a full 64KB of RAM and still provide for ROM andmemory-mapped I/O as well). Running code in the lower 64 KB part of memory on a C128 is as simple as addressing the first (lowest) bank. To access data or execute code in the upper 64 KB, it's perhaps easiest to just use the KERNAL ROM routines provided for this purpose. Alternatively, the programmer can use the MMU to establish a shared block of memory, set up a few control-transfer routines there, and then use those routines as needed. Furthermore, the 40-columnVIC-II e display chip can be configured to read from either bank of RAM. Similarly, the Atari 130XE could allow its two processors (the 6502 and theANTIC ) 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 andMicrosoft agreed on a specification calledExpanded Memory System (EMS, also stated as LIM-EMS) for use inIBM PC compatible computers runningMS-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 theUpper Memory Area . Somecomputer game s made use of this, and the feature is nowadaysemulate d by laterMicrosoft Windows operating system s to provide backwards compatibility with those programs.Video game consoles
Bank switching was also utilized in some
video game console s. TheAtari 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). TheNintendo Entertainment System contained a modified 6502 but its cartridges sometimes contained amegabit or more of ROM, addressed via bank switching called aMulti-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 SegaMega Drive cartridges were over 4MB in size and required the use of this technique (4MB being the maximum address size).TheGP2X handheld from Gamepark Holdings uses bank switching in order to control the start address (or memory offset) for the second processor.ee also
Sideways address space , an example of bank switching on theBBC Micro Computers using bank switching
*
Amstrad CPC
*Amstrad PCW
*Apple II series
*Apple III
*Commodore 128
*MSX
*PIC microcontroller
* ZX Spectrum 128 models
*Super TV-Boy External links
* [http://folklore.org/StoryView.py?project=Macintosh&story=Well_See_About_That.txt&sortOrder=Sort%20by%20Date&detail=medium Story about bank switching in the Apple II.]
Wikimedia Foundation. 2010.