Commodore 128 Programmer's Reference Manual page 420

Hide thumbs Also See for 128:
Table of Contents

Advertisement

410
COMMODORE 128
cassette, VIC bank). It distinguishes a PAL system from an NTSC one and sets
Lj
PALCNT ($A03) if PAL. The VIC, SID and 8563 devices are initialized, including
the downloading of character definitions to 8563 display RAM (if necessary). The
\ i
system 60Hz IRQ source (the VIC raster) is started. IOINIT is callable by the user
[}
via the jump table.
During initialization, the user may press certain keys as a means of selecting
, ■
an operating mode. One key checked is the Commodore key O , indicating C64
J f
mode is desired. While this key was scanned much earlier by the Z80 to speed
^
the switchover to C64 mode, there is a redundant check for it here. The only other
key scanned at this time is the
STOP
key, which signals a request by the user
j j
to power up into the Monitor utility. Note that control does not pass from the
Ij
initialization process at this point; the Kernal needs to know if RAMTAS should be
skipped. Only if the
STOP
key is depressed and this was a "warm" reset
i (
(vs. "cold" power-up) can RAMTAS be skipped.
i j
RAMTAS clears all page-zero RAM, allocates the cassette and RS-232
^
buffers, sets pointers to the top and bottom of system RAM (RAM-0), and
installs the SYSTEMLVECTOR (discussed earlier under NMI) that points to BA-
j j
SIC cold start. Lastly it sets a flag, DEJAVU ($A02), to indicate to other routines
Lj
that system RAM has been initialized. This is the difference between a "cold"
and a "warm" system. If DEJAVU contains $A5, the system is "warm" and
) /
SYSTEM—VECTOR is valid. Many programmers debugging code need to recover
(_j
from a system hang or crash via
RESET
but do not want RAM cleared. This
is why the
STOP
key is scanned, RAMTAS is skipped, and the Monitor
,
(rather than BASIC) is selected. RAMTAS is callable by the user via the jump
table.
u
RESTOR initializes the Kernal indirect vectors. This must be done before
many system routines will function. Applications that complement the operating
\ !
system via "wedges" must install them after they are initialized. RESTOR is user
Lj
callable from the jump table (see also the VECTOR call).
CINT is the Editor's initialization routine. Both 40- and 80-column display
\ >
modes are prepared, editor indirect vectors installed, programmable key definitions
i f
assigned, and the 40/80 key scnaned for default display determination. CINT is also
a jump table entry.
Finally, the IRQ's are enabled and control is passed to either BASIC
( I
initialization, GO64 code, or the ML Monitor. BASIC will call the Kernal
^
PHOENIX routine upon the conclusion of its initialization, which will call any
installed C128 cartridges (any ID) and attempt to auto-boot an application from
{
disk.
v_j
An initialization status byte, INIT_STATUS ($A04), marks the progress of
the initialization process. It is cleared automatically at the beginning of the Reset
\ i
code, and as specific stages are completed, a particular bit is set. The layout is:
JJ
B7 —> 8563 characters installed
B6 -> CINT performed
1 j
BO -> BASIC initialized
U

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents