This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Bank switching" – news ·newspapers ·books ·scholar ·JSTOR(October 2025) (Learn how and when to remove this message) |

Bank switching is a technique used in computer design to increase the amount of usable memory beyond the amount directly addressable by theprocessor[1] instructions. It can be used to configure a system differently at different times; for example, aROM required tostart a system from diskette could be switched out when no longer needed. In video game systems, bank switching allowed larger games to be developed for play on existing consoles.
Bank switching originated inminicomputer systems.[2] Many modernmicrocontrollers andmicroprocessors use bank switching to managerandom-access memory, non-volatile memory, input-output devices and system management registers in smallembedded systems. The technique was common in8-bitmicrocomputer systems. Bank-switching may also be used to work around limitations in address bus width, where some hardware constraint prevents straightforward addition of more address lines, and to work around limitations in theISA, where the addresses generated are narrower than the address bus width. Some control-oriented microprocessors use a bank-switching technique to access internal I/O and control registers, which limits the number of register address bits that must be used in every instruction.
Unlike memory management bypaging, data is not exchanged with a mass storage device likedisk storage. Data remains in quiescent storage in a memory area that is not currently accessible to the processor (although it may be accessible to the video display,DMA controller, or other subsystems of the computer) without the use of special prefix instructions.
Bank switching can be considered as a way of extending theaddress space of processor instructions with some register. Examples:
Often a single database spans several banks, and the need arises to move records between banks (as for sorting). If only one bank is accessible at a time, it would be necessary to move each byte twice: first into the common memory area, perform a bank switch to the destination bank, and then actually to move the byte into the destination bank. If the computer architecture has aDMA engine or a second CPU, and its bank access restrictions differ, whichever subsystem can transfer data directly between banks should be used.
Unlike avirtual memory scheme, bank-switching must be explicitly managed by the running program or operating system; the processor hardware cannot automatically detect that data not currently mapped into the active bank is required. The application program must keep track of whichmemory bank holds a required piece of data, and then call the bank-switching routine to make that bank active.[6] However, bank-switching can access data much faster than, for example, retrieving the data from disk storage.

Processors with16-bit addressing (8080,Z80,6502,6809, etc.) commonly used in earlyvideo game consoles andhome computers can directly address only 64 KB. Systems with more memory had to divide the address space into a number of blocks that could be dynamically mapped into parts of a larger address space. Bank switching was used to achieve this larger address space by organizing memory into separate banks of up to 64 KB each.[8] Blocks of various sizes were switched in and out via bank select registers or similar mechanisms.Cromemco was the first microcomputer manufacturer to use bank switching, supporting 8 banks of 64 KB in its systems.[9]
When using bank switching some caution was required in order not to corrupt the handling ofsubroutine calls,interrupts, themachine stack, and so on. While the contents of memory temporarily switched out from the CPU was inaccessible to the processor, it could be used by other hardware, such as video display,DMA,I/O devices, etc.CP/M-80 3.0 released in 1983 and the Z80-basedTRS-80s theModel 4 andModel II supported bank switching to allow use of more than the 64 KB of memory that the 8080 or Z80 processor could address.[10]
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 wideraddress bus. For example, theC64 used bank switching to allow for a full 64 KB of RAM and still provide for ROM andmemory-mapped I/O as well. TheAtari 130XE could allow its two processors (the 6502 and theANTIC) to access separate RAM banks, allowing programmers to make large playfields and other graphic objects without using up the memory visible to the CPU.
Microcontrollers (microprocessors with significant input/output hardware integrated on-chip) may use bank switching, for example, to access multiple configuration registers or on-chip read/write memory. An example is thePIC microcontroller. This allows short instruction words to save space during routine program execution, at the cost of extra instructions required to access relatively infrequently used registers, such as those used for system configuration at start-up.

In 1985, the companiesLotus andIntel introducedExpanded Memory Specification (EMS) 3.0 for use inIBM PC compatible computers runningMS-DOS.Microsoft joined for versions 3.2 in 1986 and 4.0 in 1987 and the specification became known as Lotus-Intel-Microsoft EMS or LIM EMS.[6][11][12] It is a form of bank switching technique that allows more than the 640 KB of RAM defined by the original IBM PC architecture, by letting it appear piecewise in a 64 KB "window" located in theUpper Memory Area.[13] The 64 KB is divided into four 16 KB "pages" which can each be independently switched. Somecomputer games made use of this, and though EMS is obsolete, the feature is nowadaysemulated by laterMicrosoft Windowsoperating systems to provide backwards compatibility with those programs.
The latereXtended 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 theReal Mode ofx86 processors in which 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 ofEMS, from the perspective of a program that uses it. Later versions of 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.
Bank switching was also used in somevideo game consoles.[14] TheAtari 2600, for instance, could only address 4 KB of ROM, so later 2600game 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).[15] TheNintendo Entertainment System contained a modified6502 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 cartridgeSRAM bank switching, and even access to such peripherals asinfrared links or rumble motors. Bank switching was still being used on later game systems. Several SegaMega Drive cartridges, such asSuper Street Fighter II were over 4 MB in size and required the use of this technique (4 MB 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.
In some types of computervideo displays, the related technique ofdouble buffering may be used to improve video performance. In this case, while the processor is updating the contents of one set of physical memory locations, the video generation hardware is accessing and displaying the contents of a second set. When the processor has completed its update, it can signal to thevideo display hardware to swap active banks, so that the transition visible on screen is free of artifacts or distortion. In this case, the processor may have access to all the memory at once, but the video display hardware is bank-switched between parts of the video memory. If the two (or more) banks of video memory contain slightly different images, rapidly cycling (page-flipping) between them can create animation or other visual effects that the processor might otherwise be too slow to carry out directly.
Bank switching was later supplanted bysegmentation in many16-bit systems, which in turn gave way topagingmemory 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.
An eight-position DIP switch on such cards is used to select one (or more) of eight banks of memory.
With memory bank select, memory space is arranged in a number of separate banks of up to 64K each.
Cromemco was the first microcomputer manufacturer to refine and exploit bank switching.