EasyManua.ls Logo

Commodore Plus 4 - Page 297

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...
The
6803
Microprocessor
285
TAY—Transfer
Value
in
Accumulator
into
Y
Register
The
value
currently
in
the
accumulator
is
placed
in
the
Y
register.
Operation:
A
-+
Y
Flags
Affected:
N,
Z
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Implied
TAY
A8
1
2
The
value
in
the
accumulator
is
not
altered.
If
the
value
transferred
is
negative,
the
N
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
If
the
value
transferred
is
zero,
the
Z
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
Example:
In
the
following
program
a
data
byte
must
be
multiplied
by
2
to
be
used
as
an
index.
Since
shifts
may
not
be
performed
on
the
Y
register,
the
shift
left
is
performed
in
the
accumulator,
and
the
result
is
copied
into
the
Y
register
using
the
TAY
instruction.
.
2000
AD
00
21
LDA
$2100
Get
the
data
byte.
.
2003
OA
ASL
Multiply
by
2.
2004
A8
TAY
Transfer
the
index
value
into
.Y.
.
2005
B9
00 22
LDA
$2200,Y
Load
the
referenced
data.
.
2008
00
BRK
Stop
processing.
TSX—Transfer
Value
in
Stack
Pointer
into
X
Register
The
value
currently
in
the
stack
pointer
is
placed
in
the
X
register.
Operation:
SP-*
X
Flags
Affected:
N,
Z
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Implied
TSX
BA
1
2
The
value
in
the
stack
pointer
is
not
altered.
If
the
value
transferred
is
negative,
the
N
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
If
the
value
transferred
is
zero,
the
Z
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
Example:
This
program
illustrates
the
functioning
of
the
stack.
The
TSX
instruction
is
used
to
copy
the stack
pointer
into
the
X
register.
The
value
of
the
stack
pointer
when
the
program
begins
executing
is
stored
at
$2100.
Then
the
accumulator
is
pushed
onto
the
stack,
and
the
resulting
stack
pointer
is
stored
at
$2101.
The
accumulator
is
then
pulled
from
the
stack,
and
the
new
stack
pointer
is
stored
at
$2102.

Other manuals for Commodore Plus 4

Related product manuals