Commodore 128 Programmer's Reference Manual page 480

Hide thumbs Also See for 128:
Table of Contents

Advertisement

470
COMMODORE 128
THE PAGE POINTERS
U
The Commodore 128 has a feature that allows you to relocate page 0 ($00-$FF) and
s ^
page 1 ($1OO-$1FF) of memory. Certain applications may require you to keep page 0
jj
intact while running BASIC, switch out the BASIC ROM, resume processing within the
control of your machine language program, and then switch 0 page and the BASIC
ROM back in. Instead of transferring 0 page with the machine language monitor, the
j j
page pointers make it easy to relocate pages 0 and 1. Four registers within the MMU,
—'
called the page pointers, allow you to do this. The page pointers are located within the
I/O block in the range $D507 through $D50A. The page pointers follow the standard
j J
8502 low-byte/high-byte format. Here are the actual addresses of the high and low bytes
vj
of the page pointers:
$D507
Page 0 Pointer (low)
1
$D508
Page 0 Pointer (high)
^
$D509
Page 1 Pointer (low)
$D50A Page 1 Pointer (high)
I I
Bit 0 of the high byte page pointers corresponds to the RAM bank number
for any page 0 address access. Bit 0 controls the generation of the CASO hardware
• j
control line if it is low and the CAS1 line if it is high, and bits 1 and 3 are
JJ
ignored.
To relocate page 0, perform a write operation on the high-byte 0 page pointer.
This is stored in the high-byte page pointer location and has no direct result until a write
j
operation is performed on the low-byte 0 page pointer. When this occurs, bits 0 through
^
7 of the low-byte page pointer correspond to the Translated Address lines TA8 through
TA15 for any 0 page address reference, which relocates the 0 page. Any subsequent 0
j j
page address is relayed to the new page zero.
lj
The page 1 pointer works the same way. Both pairs of pointers are initialized to 0
upon power-up, placing pages 0 and 1 in actual page 0 and page 1 locations.
] j
It is important to note that memory addresses 0 and 1 are always available at those
[j
absolute address references, regardless of whether pages zero or one are relocated.
The page zero low-byte pointer directly replaces the high-order address of zero
^
page (normally 00). When pages zero and one are directed to locations in RAM memory
)
above page one, the MMU translates the addresses back to the normal locations of pages
zero and one, effectively swapping those two pages of memory. This address translation
applies only to RAM; ROM and I/O registers are not back-translated. VIC chip
j
addresses are not translated back to their original memory locations, so you must ensure
^
that you do not place page zero or one in the address of the VIC chip. The ROM
appearing in these address ranges still overlays the RAM regardless of whether the RAM
j f
is zero page, page one or any other page of RAM memory. If you need to use the
U
Kernal, the necessary variables required for the Kernal routine must be placed in
memory where the Kernal is in context, Machine Language Monitor bank 15 ($0F) for
>
example.
)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents