Commodore 128 Programmer's Reference Manual page 470

Hide thumbs Also See for 128:
Table of Contents

Advertisement

460
COMMODORE 128
of your program needs to access the character ROM, which is only visible to the 8502 in
bank 14. Change to bank 14; then read the character ROM data, which makes up the
images of the characters in the character sets. While the microprocessor is "looking" in
bank 14, the VIC chip is not available to the microprocessor, so you must issue another
_
BANK command in order to return to (a configuration containing I/O and) processing
VIC video information.
I \
In machine language, switching banks is a little more difficult. You must change
[J
the value of the registers [in particular the Configuration Register (CR), Load Config
uration Register (LCR) and Preconfiguration Register (PCR)], either directly or
■-
indirectly. The Kernal routine GETCFG allows you to change configurations and
j
maintains the same ones used by BASIC and the Monitor as they appear in Figure 13-3.
^
There are four PCR's and four LCR's (as shown in Figure 13-4). Each PCR corresponds
directly to a LCR. PCR A pertains to LCR A, PCR B corresponds to LCR B, and so on.
j
To change the value of the Configuration Register directly, perform a write
[_,
operation (STA, STX, STY) to the Configuration Register.
To change the value of the Configuration Register indirectly, write a value
r »
specifying a memory configuration to the Preconfiguration Register. When a subsequent
|
store instruction is performed to the corresponding Load Configuration Register, the
value previously stored in the corresponding PCR is loaded into the CR. When a store
instruction is executed on an LCR, the value in the corresponding PCR is loaded into the
I |
CR and the memory management organization conforms to the values associated with
U
that memory management scheme. The value written to the LCR is of no consequence;
any value triggers the preconfiguration mechanism.
\ i
NOTE: Basic expects the LCR's and PCR's to be left alone. If you use
them to manage memory in your application, do not plan on using BASIC.
THE CONFIGURATION REGISTER
| j
The Configuration Register (CR) is the most important register in the MMU. It specifies
and organizes the ROM, RAM and input/output configurations for the entire Commo
dore 128 memory in C128 mode. (The MMU is not present at all in the C64 memory
j I
map.) The CR is located at address $D500 when I/O is available and at address $FF00 at
U
all times. When I/O functions are disabled, the MMU memory disappears between
$D500 and $D50B. The MMU memory is always present between $FF00 and $FF04.
Each of the eight bits in the CR controls a separate memory function.
Bit 0 (zero) in the Configuration Register specifies whether I/O Registers are
^
available, or whether ROM (High) is present in the memory range $D000 through
$DFFF. The I/O Registers consist of the registers of the VIC chip, SID chip, MMU
j I
(from $D500 through $D50B); CIA number 1, which controls the joystick port; and CIA
U
number 2, which controls the serial bus and user port. If bit 0 is high (equal to 1), ROM
or RAM is present in the range $D000 through $DFFF, depending upon the values of
the ROM HIGH bits (4 and 5) in this register. If bit 0 is low (equal to 0), I/O is present
) f
in this range. The value of bit 0 on power-up is 0.
^
LJ

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents