Download super-extended-basic..
Transcript
SUPER EXTENDED BASIC UNRAVELLED II MEMORY MANAGEMENT ORIGIN: SPECTRAL ASSOC REVISED:12/26/99 WALTER K ZYDHEK There is one final aspect of the Color Computer 3’s memory management system, which must be addressed. The Color Computer 3 has two sets of MMU registers. The first set of eight registers located at $FFA0 should be very familiar to you by now. The second set of eight registers is located at $FFA8 and their function is identical to that of the first set in every aspect. Bit 0 of initialization register 1 ($FF91) is used to determine which one of the sets of registers is determining the makeup of the logical address space. If bit 0 if $FF91 is set to zero, then the eight MMU registers at $FFA0 (task register 0) control the makeup of the logical address space. If bit 0 of $FF91 is set, then the eight MMU registers at $FFA8 (task register 1) control the makeup of the logical address space (see Figure 3). The theory behind the two sets of registers is that each set of registers may be allowed to control a different task by allocating two independent segments of 64K to each task and then simply selecting the desired set of registers in order to enable the desired task. This will work fine but you must be careful to remember that switching between the task registers will do nothing to preserve the status of the CPU registers, nor will it protect you from disasters if you should be interrupted during the transition. Whenever new memory is switched into a logical address space, be sure it isn’t where the program counter, stack, or interrupt service routine is located. Major problems may happen it is: Then the following blocks compose the logical address space $FF91 $FF91 bit0=1 bit0=0 $0000 24 34 $2000 26 56 $4000 15 43 $6000 56 34 $8000 41 35 $A000 42 08 $C000 62 36 $E000 61 00 If the MMU registers have the data below in them $FFA0 $FFA1 $FFA2 $FFA3 $FFA4 $FFAS $FFA6 $FFA7 24 26 15 56 41 42 62 61 $FFA8 $FFA9 $FFAA $FFAB $FFAC $FFAD $FFAE $FFAF 34 56 43 34 35 08 36 00 Figure 3 - MMU task registers Special notes: 1) All of the MMU registers may be read from as well as written to. However, only the lower 6 bits of data are accurate. The top two bits should be masked off after they are read. Also, in order to enable the MMU registers, bit 6 of $FF90 must be set. 2) The CoCo enable bit (bit 7, $FF90) does not have any effect upon the operation of the MMU registers. The MMU enable bit (bit 6, $FF90) must be set in order for the MMU registers to be operable. 3) The area from $FF00 - $FFFF is used for system input/output and is never affected by the MMU registers. The area from $FE00 - $FEFF is a special page (256 bytes) of RAM and may be affected by the MMU registers if MC3 (bit 3, $FF90) is clear. 12