Knowledge (XXG)

Bank switching

Source 📝

192: 153:
remain at their original length, so the processor cannot directly span all of bank-switched memory by, for example, incrementing an internal register. Instead the processor must explicitly do a bank-switching operation to access large memory objects. There are other limitations. Generally a bank-switching system will have one block of program memory that is common to all banks; no matter which bank is currently active, for part of the address space only one set of
29: 325: 235:. 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. Blocks of various sizes were switched in and out via bank select registers or similar mechanisms. 356:
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. 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
165:
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
152:
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
36:
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
486:
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
481:
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 the
91:, 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. 177:
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 which
424:
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
400:, 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. 126:
The follow-on system to a processor with a 15 bit address 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
316:. 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. 122:
The follow-on system to a processor with a 12 bit address has a 15 bit address bus, but there is no way to directly specify the high three bits on the address bus. Internal bank registers can be used to provide those
86:
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 the
395:
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
182:
holds a required piece of data, and then call the bank-switching routine to make that bank active. However, bank-switching can access data much faster than, for example, retrieving the data from disk storage.
312:(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 the 146:, 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. 487:
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.
142:
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
510:. 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. 254:, 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, 1010: 56:
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.
281:
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
102:. 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, 301:) to access separate RAM banks, allowing programmers to make large playfields and other graphic objects without using up the memory visible to the CPU. 170:
engine or a second CPU, and its bank access restrictions differ, whichever subsystem can transfer data directly between banks should be used.
478: 465:
handheld from Gamepark Holdings uses bank switching in order to control the start address (or memory offset) for the second processor.
980: 943: 908: 785: 690: 656: 557: 44:
is a technique used in computer design to increase the amount of usable memory beyond the amount directly addressable by the
1006: 140:
addresses, could be accessed. The processor could change which set is in current use by setting or clearing the latch bit.
445:
cartridges used a chip called MBC (Memory Bank Controller), which not only offered ROM bank switching, but also cartridge
426: 397: 380: 278:
supported bank switching to allow use of more than the 64 KB of memory that the 8080 or Z80 processor could address.
383:(XMS), also now obsolete, is a standard for, in principle, simulating bank switching for memory above 1 MB (called " 88: 446: 1040: 461:
were over 4 MB in size and required the use of this technique (4 MB being the maximum address size). The
191: 157:
will be used. This area would be used to hold code that manages the transitions between banks, and also to process
239:
was the first microcomputer manufacturer to use bank switching, supporting 8 banks of 64 KB in its systems.
132:
A processor with a 16-bit external address bus can only address 2 = 65536 memory locations. If an external
1035: 773: 620: 483: 458: 438: 682: 676: 519: 507: 725: 528: 361:. The 64 KB is divided into four 16 KB "pages" which can each be independently switched. Some 294: 45: 255: 167: 103: 72: 752:
An eight-position DIP switch on such cards is used to select one (or more) of eight banks of memory.
136:
was added to the system, it could be used to control which of two sets of memory devices, each with
931: 430: 313: 133: 798:
With memory bank select, memory space is arranged in a number of separate banks of up to 64K each.
601: 586: 48:
instructions. It can be used to configure a system differently at different times; for example, a
737: 713: 413: 224: 935: 925: 648: 976: 972: 966: 939: 904: 781: 686: 652: 553: 401: 370: 358: 345: 290: 811: 777: 766: 729: 640: 574: 373: 242:
When using bank switching some caution was required in order not to corrupt the handling of
199:
memory board was used to map the memory into one or more of eight distinct 64 KB banks.
49: 148:
Because the external bank-selecting latch (or register) is not directly connected with the
841: 453:
or rumble motors. Bank switching was still being used on later game systems. Several Sega
384: 341: 309: 275: 154: 149: 143: 76: 64: 575: 289:
used bank switching to allow for a full 64 KB of RAM and still provide for ROM and
829:
Cromemco was the first microcomputer manufacturer to refine and exploit bank switching.
496: 421: 333: 271: 174: 106:, or other subsystems of the computer) without the use of special prefix instructions. 68: 28: 1029: 1018: 641: 474: 362: 228: 115: 83: 75:, non-volatile memory, input-output devices and system management registers in small 741: 286: 259: 99: 60: 861:"New 1-2-3 Gets 4 Megabytes of Memory, Lotus, Intel Break PC DOS Memory Barrier". 582: 282: 179: 166:
to move the byte into the destination bank. If the computer architecture has a
454: 417: 324: 251: 243: 33: 900: 880: 863: 846: 816: 733: 523: 388: 353: 263: 247: 158: 450: 442: 366: 236: 232: 196: 434: 53: 365:
made use of this, and though EMS is obsolete, the feature is nowadays
504: 500: 349: 267: 204: 95: 20: 420:, for instance, could only address 4 KB of ROM, so later 2600 337: 323: 298: 190: 137: 80: 27: 462: 220: 216: 208: 392: 212: 927:
American inventors, entrepreneurs & business visionaries
114:
Bank switching can be considered as a way of extending the
550:
The Microprocessor and its application: an advanced course
376:
to provide backwards compatibility with those programs.
118:
of processor instructions with some register. Examples:
98:, data is not exchanged with a mass storage device like 449:
bank switching, and even access to such peripherals as
404:
emulates XMS also, for those programs that require it.
968:
Hardware hacking: have fun while voiding your warranty
844:(1982-10-25). "Digital Research offers CP/M upgrade". 437:
or more of ROM, addressed via bank switching called a
965:
Grand, Joe; Russell, Ryan; Mitnick, Kevin D. (2004).
897:
The Handbook of Software for Engineers and Scientists
812:"Share and Share Alike: Multiuser Hardware Explained" 16:
A technique to increase the amount of usable memory
765: 622:Control Data 3600 Computer System Reference Manual 37:part of memory is not accessible to the processor. 924:Sinofsky, Brian (2002). Carey, Charles W. (ed.). 297:could allow its two processors (the 6502 and the 878:"EMS Update Gives DOS Improved Multitasking". 670: 668: 603:Control Data 160-A Computer Programming Manual 387:"), which is not directly addressable in the 8: 1007:"Story about bank switching in the Apple II" 768:Introduction to Microprocessor System Design 714:"Design Innovations in Personal Computers" 577:Computer structures: readings and examples 433:but its cartridges sometimes contained a 573:Bell, C. Gordon; Newell, Allen (1971). 540: 495:Bank switching was later supplanted by 266:3.0 released in 1983 and the Z80-based 820:. Vol. 3, no. 11. p. 18 609:. CDC. March 1963. p. 2-09. 145e. 522:, an example of bank switching on the 412:Bank switching was also used in some 7: 491:Alternative and successor techniques 344:Specification (EMS) 3.0 for use in 681:(2 ed.). Que Books. pp.  231:can directly address only 64  14: 1013:from the original on 2020-12-12. 552:. CUP Archive. pp. 47–50. 223:, etc.) commonly used in early 79:. The technique was common in 1: 712:Garland, Harry (March 1977). 427:Nintendo Entertainment System 381:eXtended Memory Specification 328:Expanded memory in the IBM PC 71:use bank switching to manage 59:Bank switching originated in 503:, which in turn gave way to 94:Unlike memory management by 895:Ross, Paul W., ed. (1995). 678:Upgrading and Repairing PCs 477:, the related technique of 1057: 810:Hogan, Thom (1981-06-08). 548:Aspinall, D., ed. (1978). 473:In some types of computer 18: 1019:"What Is Bank Switching?" 774:McGraw-Hill Book Company 357:"window" located in the 19:Not to be confused with 764:Garland, Harry (1979). 734:10.1109/c-m.1977.217669 675:Mueller, Scott (1992). 643:Embedded systems design 508:memory management units 459:Super Street Fighter II 439:Multi-Memory Controller 332:In 1985, the companies 520:Sideways address space 484:video display hardware 329: 200: 195:Bank select switch on 38: 971:. Syngress. pp.  726:IEEE Computer Society 639:Heath, Steve (2003). 529:Overlay (programming) 429:contained a modified 327: 194: 63:systems. Many modern 31: 457:cartridges, such as 73:random-access memory 932:Infobase Publishing 647:. Newnes. pp.  600:"Storage Control". 414:video game consoles 408:Video game consoles 314:PIC microcontroller 285:. For example, the 225:video game consoles 348:computers running 330: 201: 39: 1041:Memory management 628:. CDC. 60021300E. 402:Microsoft Windows 374:operating systems 371:Microsoft Windows 359:Upper Memory Area 346:IBM PC compatible 291:memory-mapped I/O 187:Microcomputer use 1048: 1022: 1014: 993: 992: 990: 989: 962: 956: 955: 953: 952: 921: 915: 914: 892: 886: 885: 875: 869: 868: 858: 852: 851: 842:Freiberger, Paul 838: 832: 831: 826: 825: 807: 801: 800: 795: 794: 771: 761: 755: 754: 749: 748: 709: 703: 702: 700: 699: 672: 663: 662: 646: 636: 630: 629: 627: 617: 611: 610: 608: 597: 591: 590: 580: 570: 564: 563: 545: 479:double buffering 469:Video processing 310:Microcontrollers 305:Microcontrollers 203:Processors with 155:memory locations 77:embedded systems 65:microcontrollers 1056: 1055: 1051: 1050: 1049: 1047: 1046: 1045: 1036:Computer memory 1026: 1025: 1017: 1005: 1002: 997: 996: 987: 985: 983: 964: 963: 959: 950: 948: 946: 923: 922: 918: 911: 894: 893: 889: 877: 876: 872: 860: 859: 855: 840: 839: 835: 823: 821: 809: 808: 804: 792: 790: 788: 763: 762: 758: 746: 744: 711: 710: 706: 697: 695: 693: 674: 673: 666: 659: 638: 637: 633: 625: 619: 618: 614: 606: 599: 598: 594: 572: 571: 567: 560: 547: 546: 542: 537: 516: 493: 471: 422:game cartridges 410: 385:extended memory 342:Expanded Memory 322: 307: 189: 150:program counter 147: 141: 112: 69:microprocessors 32:A hypothetical 24: 17: 12: 11: 5: 1054: 1052: 1044: 1043: 1038: 1028: 1027: 1024: 1023: 1015: 1001: 1000:External links 998: 995: 994: 981: 957: 944: 916: 909: 903:. p. 26. 887: 870: 853: 833: 802: 786: 756: 704: 691: 664: 657: 631: 612: 592: 565: 558: 539: 538: 536: 533: 532: 531: 526: 515: 512: 501:16-bit systems 492: 489: 475:video displays 470: 467: 451:infrared links 409: 406: 363:computer games 321: 318: 306: 303: 229:home computers 188: 185: 175:virtual memory 163: 162: 129: 128: 124: 111: 108: 104:DMA controller 54:start a system 42:Bank switching 15: 13: 10: 9: 6: 4: 3: 2: 1053: 1042: 1039: 1037: 1034: 1033: 1031: 1021:. 2024-02-02. 1020: 1016: 1012: 1008: 1004: 1003: 999: 984: 982:1-932266-83-6 978: 974: 970: 969: 961: 958: 947: 945:0-8160-4559-3 941: 937: 933: 929: 928: 920: 917: 912: 910:0-8493-2530-7 906: 902: 898: 891: 888: 884:. 1987-08-17. 883: 882: 874: 871: 867:. 1985-04-29. 866: 865: 857: 854: 849: 848: 843: 837: 834: 830: 819: 818: 813: 806: 803: 799: 789: 787:0-07-022871-X 783: 779: 775: 770: 769: 760: 757: 753: 743: 739: 735: 731: 727: 723: 719: 715: 708: 705: 694: 692:0-88022-856-3 688: 684: 680: 679: 671: 669: 665: 660: 658:0-7506-5546-1 654: 650: 645: 644: 635: 632: 624: 623: 616: 613: 605: 604: 596: 593: 588: 584: 579: 578: 569: 566: 561: 559:0-521-22241-9 555: 551: 544: 541: 534: 530: 527: 525: 521: 518: 517: 513: 511: 509: 506: 502: 498: 490: 488: 485: 480: 476: 468: 466: 464: 460: 456: 452: 448: 444: 440: 436: 432: 428: 423: 419: 415: 407: 405: 403: 399: 394: 390: 386: 382: 377: 375: 372: 368: 364: 360: 355: 351: 347: 343: 339: 335: 326: 319: 317: 315: 311: 304: 302: 300: 296: 293:as well. The 292: 288: 284: 279: 277: 273: 269: 265: 261: 257: 253: 252:machine stack 249: 245: 240: 238: 234: 230: 226: 222: 218: 214: 210: 206: 198: 193: 186: 184: 181: 176: 171: 169: 160: 156: 151: 145: 144:I/O addresses 139: 135: 131: 130: 125: 121: 120: 119: 117: 116:address space 109: 107: 105: 101: 97: 92: 90: 85: 84:microcomputer 82: 78: 74: 70: 66: 62: 57: 55: 51: 47: 43: 35: 30: 26: 22: 986:. Retrieved 967: 960: 949:. Retrieved 926: 919: 896: 890: 879: 873: 862: 856: 850:. p. 1. 845: 836: 828: 822:. Retrieved 815: 805: 797: 791:. Retrieved 767: 759: 751: 745:. Retrieved 721: 717: 707: 696:. Retrieved 677: 642: 634: 621: 615: 602: 595: 576: 568: 549: 543: 497:segmentation 494: 472: 411: 378: 331: 308: 280: 241: 207:addressing ( 202: 172: 164: 113: 100:disk storage 93: 61:minicomputer 58: 52:required to 41: 40: 25: 934:. pp.  585:. pp.  583:McGraw Hill 340:introduced 295:Atari 130XE 283:address bus 260:I/O devices 180:memory bank 1030:Categories 988:2020-02-08 951:2020-02-08 824:2020-02-08 793:2020-02-08 776:. p.  747:2020-02-08 698:2020-02-08 535:References 455:Mega Drive 418:Atari 2600 379:The later 320:The IBM PC 248:interrupts 244:subroutine 159:interrupts 34:memory map 901:CRC Press 881:InfoWorld 864:InfoWorld 847:InfoWorld 817:InfoWorld 524:BBC Micro 389:Real Mode 369:by later 354:Microsoft 173:Unlike a 110:Technique 46:processor 1011:Archived 742:32243439 718:Computer 514:See also 499:in many 443:Game Boy 367:emulated 276:Model II 237:Cromemco 197:Cromemco 936:322–324 683:699–700 435:megabit 272:Model 4 268:TRS-80s 264:CP/M-80 262:, etc. 246:calls, 979:  942:  907:  784:  740:  728:: 25. 689:  655:  556:  505:paging 416:. The 350:MS-DOS 250:, the 205:16-bit 96:paging 21:Paging 738:S2CID 724:(3). 626:(PDF) 607:(PDF) 338:Intel 334:Lotus 299:ANTIC 138:65536 134:latch 127:bank. 123:bits. 81:8-bit 977:ISBN 940:ISBN 905:ISBN 782:ISBN 687:ISBN 653:ISBN 554:ISBN 463:GP2X 447:SRAM 431:6502 336:and 274:and 270:the 227:and 221:6809 217:6502 209:8080 67:and 973:229 730:doi 649:242 587:156 398:EMS 393:x86 391:of 287:C64 256:DMA 213:Z80 168:DMA 89:ISA 50:ROM 1032:: 1009:. 975:. 938:. 930:. 899:. 827:. 814:. 796:. 780:. 778:93 772:. 750:. 736:. 722:10 720:. 716:. 685:. 667:^ 651:. 581:. 441:. 352:. 258:, 233:KB 219:, 215:, 211:, 991:. 954:. 913:. 732:: 701:. 661:. 589:. 562:. 161:. 23:.

Index

Paging

memory map
processor
ROM
start a system
minicomputer
microcontrollers
microprocessors
random-access memory
embedded systems
8-bit
microcomputer
ISA
paging
disk storage
DMA controller
address space
latch
65536
I/O addresses
program counter
memory locations
interrupts
DMA
virtual memory
memory bank

Cromemco
16-bit

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.