EasyManua.ls Logo

Commodore VIC-20 - Page 150

Commodore VIC-20
308 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...
backwards
in
memory,
f
,e.,
the
first
position
in
the
stack
is
at
$01FF,
and
the
last
is
at
SOT
00.
Another
register
in
the
6502
microproces
sor
that
hasn't
been
mentioned
yet
is
called
the
"stack
pointer,"
and
it
always
points
at
the next
available
location
En
the
stack.
When
something
is
pushed
onto
the
stack,
it
is
placed
where
the
stack
pointer
points
toT
and
the
stack
pointer
is
moved
down
to
the
next
position
(decremented).
When
something
is
pulled
oft
the
stack,
the
stack
pointer
is
incremented,
and
the
byte
pointed
to
by
the
stack
pointer
(at
S0100
offset
by
the
contents
of
the stack
pointer)
is
placed
into
the
specified
register.
Up
to
this
point,
we
have
covered
immediate,
zero
page,
and
absolute
mode
instructions.
We
have
also
covered
(but
have
not
stated)
the
"implied11
mode,
which
means
that
the
instruction
itself
tells
what
registers/flags/memory
the
instruction
is
referring
to.
The
examples
we
have
seen
are
PHA,
PLAT
PHP,
and
PLP, which
refer
to
stack
processing
and
the
accumulator
and
status
registers.
i
The
X
register
will
be
referred
to
as
X
from
now
on,
and
similarly
with
A
-
accumulator,
Y -
Y
index
register,
S -
stack
pointer,
and
P
-
processor
status).
INDEXING
Indexing
plays
an
extremely
important
part
in
the
running
oi
the
6502
microprocessor.
It
can be
defined
as
"creating
an
actual
address
from a
base
address
plus
the
contents
of
either
the
X
or
Y
index
registers."
For
example,
if
X
contains $05,
and
the
microprocessor
executes
an
LDA
instruction
in
the
"absolute
X
indexed
mode11
with
base
address,
e.g.,
S9Q0Q,
then
the
actual
location that
is
loaded
into
the
A
register
is
S9000 +
S05
=
S9005.
The
mnemonic
format
of
an
absolute
indexed
instruction
is
the
same
as
an
absolute
[nstruction
except a
",X"
or
",Y"
denoting
the
index
is
added
to
the
address,
e.g.:
LDA
S9000,X
INDIRECT
INDEXED
ADDRESSING
This
mode
allows
the
program
to
choose
a
memory
location
from
256
adjacent
locations.
The
address
of
the
lowest
location
is
stored
in
zero
page,
and
the
value
in
the
Y
register
is
added
to
that
address
to
choose
the
final
address.
For
example,
we
will
place
a
S45
in
location
$01,
and
a
$1E
in
location
$02,
We
will
use
the
instruction
to
load
the
accumulator
in
the
indirect
indexed
modef
specifying
zero
page
address
S01
as
the
134

Other manuals for Commodore VIC-20

Related product manuals