EasyManua.ls Logo

Commodore Plus 4 - Page 316

Commodore Plus 4
464 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
304
Machine
Language
on
the
Commodore
Plus/4
The
Plus/4
is
designed
to
allow
the
microprocessor
to
look
at
ROM
or
RAM
in
the
address
spaces
$8000-$FCFF
and
$FF40-$FFFF.
The
intervening
address
space
is
occupied
by
I/O
and
the
graphics
chip.
When
the
Plus/4
is
first
turned
on, the
microprocessor
is
initialized
to
look
at
ROM.
Logically
it
must
be
so,
or
the
computer
would
have
no
program
instructions
to
operate
with.
To
switch
to
looking
at
RAM,
a
store
is
done
to
location
$FF3F.
To
switch
back
to
ROM,
a
store
is
done
to
location
$FF3E.
When
the
ROM
is
banked
in,
a
load
from
its
area of
memory
results
in
reading
the
ROM.
A
store
to
its
area of
memory
stores
the
byte
into
the
RAM
underneath
the
ROM.
This
makes
it
possible,
for
example,
to
store
a
new
character
set
in
the
RAM
underneath
the
character
ROM
without
banking
in
the
RAM.
Then
the
graphics
chip
can
be
told to
look
at
it.
Considerable
care
must
be
taken
when
banking
out
the
operating
system
ROM
to
operate
in
RAM.
For
example,
the
interrupt
service
vector
at
$FFFE-$FFFF,
which
is
set
correctly
in
the
operating
system
ROM,
may
not
be
set
in
RAM.
And,
when
setting
it
in
RAM,
remember
that
the
interrupt
service
routine
it
normally
points
to
resides
in
the
operating
system
ROM
and
is
no
longer
present.
For
use
of
the
upper
32K
of
RAM
for
data,
storing
data
to
RAM
does
not
require
banking
the
RAM
in.
When
loading
the
data,
it
is
possible
to
simply
stop
interrupts
(using
the
SEI
instruction)
before
banking
in
RAM
and
fetching
data.
ROM
can
then
be
banked
back
in
and
interrupts
reenabled
(using
the
CLI
instruction).
This
is
the
method
used
by
BASIC
to
allow
60671
bytes
free.
In
addition
to
allowing
switching
between
ROM
and
RAM,
the
Plus/4
allows
switching
between
several
different
ROMs
in
the
address
spaces
$8000-$FBFF
and
$FF40-$FFFF.
This
is
accomplished
by
means
of
the
cartridge
bank
port
at
$FDD0-$FDDF,
each
location
of
which
could
switch
in
a
different
ROM
when
stored
to.
Routines
to
facilitate
the
exchange
of
information
between
the
operat
ing
system
and
a
cartridge
program
are
located
from
$FC00-$FCFF
and
are
present
in
every
ROM
configuration.
The
Plus/4
built-in
software
resides
in
cartridge
bank
5.
ROM
Subroutines
The
operating
system
ROM
in
the
Plus/4
contains
a
jump
table
to
various
operating
system
subroutines.
It
is
important
to
call
operating
system
subroutines
only
through
the
jump
table
when
writing
software
designed
to
run
on
any
Plus/4
computer.
The
reason
for
this
is
that
the
manufacturer
occasionally
makes
changes
in
the
operating
system
that
result in
a
change
in
the
location
of
an
operating
system
routine.
But
the
address
of
the
subroutine
call
in
the
jump
table
remains
unchanged.
Before
using
operating
system
routines
in
a
program,
it
is
usually
a
good
idea
to
experiment
with
them;
some
have
so
many
possible
variations
that
it
is
difficult
to
analyze
how
they
function
in
every
possible
circumstance.