thumb|right|A hypothetical [[memory map of bank-switched memory for a processor that can only address 64 KB. This scheme shows 200 KB of memory, of which only 64 KB can be accessed at any time by the processor. The operating system must manage the bank-switching operation to ensure that program execution can continue when part of memory is not accessible to the processor.]]

Bank switching is a technique used in computer design to increase the amount of usable memory beyond the amount directly addressable by the processor

  • The CDC 1604 has 15-bit addresses; the follow-on CDC 3600 system has an 18-bit address bus, but legacy instructions only have 15 address bits; internal bank registers can be used to provide those bits. Some new instructions can explicitly specify the bank.

<!-- Much of this text should be split off into a section on microprocessors. -->

  • A processor with a 16-bit external address bus can only address 2<sup>16</sup>&nbsp;= 65536 memory locations. If an external latch was added to the system, it could be used to control which of two sets of memory devices, each with 65536 addresses, could be accessed. The processor could change which set is in current use by setting or clearing the latch bit. <br>The latch can be set or cleared by the processor in several ways; a particular memory address may be decoded and used to control the latch, or, in processors with separately-decoded I/O addresses, an output address may be decoded. Several bank-switching control bits could be gathered into a register, approximately doubling the available memory spaces with each additional bit in the register. <br>Because the external bank-selecting latch (or register) is not directly connected with the program counter of the processor, it does not automatically change state when the program counter overflows; this cannot be detected by the external latch since the program counter is an internal register of the processor. The extra memory is not seamlessly available to programs. Internal registers of the processor remain at their original length, so the processor cannot directly span all of bank-switched memory by, for example, incrementing an internal register. 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).

</references>