Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site myrias.UUCP Path: utzoo!utcsri!ubc-vision!alberta!myrias!sjl From: sjl@myrias.UUCP (Stuart Lomas) Newsgroups: net.micro.apple Subject: Re: bank switching for large memories Message-ID: <243@myrias.UUCP> Date: Thu, 24-Apr-86 19:27:34 EST Article-I.D.: myrias.243 Posted: Thu Apr 24 19:27:34 1986 Date-Received: Thu, 24-Apr-86 21:42:51 EST References: <1840@ihlpg.UUCP> Organization: Myrias Research, Edmonton Lines: 76 > After looking at several memory expansion boards for my Apple ][+, I think I > understand the concept, but I would like more details of how the bank > switching really works. > ... > For the 128Kb expansion, what mechanism is used? How big are the "chunks" > that are switched? Are all chunks switched into the same region in the > address spectrum, or can a 16Kb expansion coexist peacefully with a 128Kb > expansion? Can two 128Kb expansions coexist in harmony? Do the companies > that make the 1 MEG (!) expansions use a different technique? Has any sort > of standard evolved? I noticed that some expansion boards need a ribbon > cable connected to the motherboard, others do not. Why??? > ... > > tim born > ...ihnp4!ihlpg!timborn I am also interested in this area. To get the information flowing, let me throw in what I know. The "standard" 16K expension (ie Microsoft RAM card) actually fits into the 12K of address space between $D000 and $FFFF, overlapping the space otherwise occupied by the ROMs. This is accomplished by providing a 12K bank which maps from $D000 to $FFFF and a 4K bank that maps from $D000 to $DFFF. When the 4K bank is selected, the bottom 4K of the 12K bank is invisible, but the top 8K is visible. Think of this as a 16K bank consisting of an 8K bank which is always visible when the 16K bank is active, and two 4K bank of which exactly one is visible when the 16K bank is active. The "standard" 128K card simply extends this scheme by providing multiple 16K banks, each of which looks exactly like the 16K bank of the standard 16K card. A 128K card consists of 8 16K banks, each of which is mapped as described above. Multiple 128K cards can be used at once (with at most 1 active at a time), and 128K cards can coexist with 16K cards. Apparently, intermediate sizes of cards (32K, 64K) have also been made (or can be made by partially populating a 128K card), and they can also be used in conjunction with other cards. "Non-standard" 128K cards also exist, such as the MicroTek Q-Disk. This card works by mapping a selectable 256 byte page of its 128K memory into the 256 bytes provided in the $Cxxx space for each card. This is not useful as bank switched program memory, but works fine for RAM disk. My own configuration consists of a 16K Microsoft RAM card in slot 0, a 128K MicroTek Q-Disk in slot 4, and a 128K Saturn card in slot 5. I run Apple Pascal 1.1 almost exclusively, which uses the 16K card for operating system code. I use both 128K cards as RAM disks. If I am short of slots, I can remove the 16K card and move the 128K Saturn card (a "Standard" 128K card) to slot 0. The Pascal system will then use 16K of the 128K Saturn card, and I can use the remaining 112K as RAM disk. My computer is an Apple ][+. There is a problem with the "standard" memory mapping scheme. If you want to use interrupts, you have to set an interrupt vector at $FFFA, $FFFC or $FFFE (depending on what you want to trap) to point to your interrupt handler. This is a hardware feature of the 6502 processor and cannot be changed. Unfortunately, these interrupt vectors are in the bank switched memory, so you have to duplicate your interrupt vectors in every 16K bank, and avoid using the top 6 bytes of each bank for anything else. Most Apple users will not find this to be a problem, because most apple programs do not use interrupts of any kind, except possibly for trapping the BREAK key. I have no idea how the 1Meg and larger cards are implemented. I suspect that they are not done using the "standard" scheme I have described above, because a 128K card uses all of the 16 io locations assigned to it in page $C0xx for bank selection. In fact, I suspect that they do not provide mappable memory at all, but rather provide a fast way of copying memory into and out of the card. Can anyone fill me in on this? Stuart Lomas Myrias Research Corporation Edmonton, Alberta, Canada ihnp4!alberta!myrias!sjl