EasyManua.ls Logo

Commodore Plus 4 - Page 299

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
6502
Microprocessor
387
TXS—Transfer
Value
in
X
Register
into
Stack
Pointer
The
value
currently
in
the
X
register
is
placed
in
the
stack
pointer.
Operation:
X^
SP
Flags
Affected:
None
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Implied
TXS
9A
1
2
The
value
in
the
X
register
is
not
altered.
The
information
stored
in
the
stack
area
(page
1)
is
not
changed
by
this
instruction.
Only
which
byte
the
stack
pointer
points
to
is
changed.
Example:
When
the
computer
is
reset,
part
of
the
process
is
to
reset
the
stack
pointer
to
its
initial
value,
$FF.
This
example
illustrates
how
that
would
be
done
using
the
TXS
instruction.
.
sooo
.
2002
.
2003
A2
PP
9A
00
LDX
TXS
BKK
#$PP
Load
.X
with
the
value.
Transfer
to
SP.
Stop
processing.
desired
pointer
TYA—Transfer
Value
in
Y
Register
into
Acciunulator
The
value
currently
in
the
Y
register
is
placed
in
the
accumulator.
Operation:
Y-+A
Flags
Affected:
Nf
Z
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Implied
TYA
98
I
2
The
value
in
the
Y
register
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
finds
the
offset
from
$8020
of
the
first
location
containing
the
value
SEA
in
$8020-$811F
by
incrementing
the
Y
register.
Then
the
offset
from
$8000
is
calculated
using
the
TYA
instruction
to
transfer
the
contents
of
the
Y
register
to
the
accumulator
and
adding.
Note
that
the
status
of
the
carry
bit
at
$2010
indicates
whether
the
first
$EA
occurs
in
$8020-$80FF
(carry
clear)
or
$8100-$811F
(carry
set).
.
2000
A0
00
LDY
#100
Start
.Y
at
zero.
.
2002
A9
EA
LDA
#$EA
Load
the
accumulator
with
the
byte
to
search
for.

Other manuals for Commodore Plus 4

Related product manuals