EasyManua.ls Logo

Commodore Plus 4 - Page 298

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...
2000
2001
2004
2005
2006
2009
200A
200B
200E
BA
8E
48
BA
8E
68
BA
8E
00
00
01
02
21
21
21
TSX
STX
PHA
TSX
STX
PLA
TSX
STX
BRK
$2100
#2101
$2102
mmtmp^*mmB^0
^mm^m'
mm
^mr
m^
M^pvw^a
Transfer
the
initial
SP
value
to
.X
Store
at
$2100.
Push
.A
onto
the
Transfer
the
new
Store
at
$2101.
Pull
.A
from
the
Transfer
the
new
Store
at
$2101.
Stop
processing.
stack.
SP
value
to
.X.
stack.
SP
value
to
.X.
The
M
(Memory)
command
may
be
used
to
examine
$2100-$2102
following
the
execution
of
this
example
program.
See
the
section
on
the
stack
for
more
information.
TXA.—Transfer
Value
in
X
Register
into
Acciunulator
The
value
currently
in
the
X
register
is
placed
in
the
accumulator.
Example:
Operation:
X
-*
A
Addressing
Mode
Syntax
Flags
Affected:
N,
Z
Opcode
Bytes
Cycles
Implied
TXA
8A
1
The
value
in
the
X
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.
In
this
example
the
bits
set
to
1
in
the
value
of
$2100
are
counted.
This
is
done
in
the
X
register
because
the
accumulator
cannot
be
incremented.
The
value
obtained
is
then
transferred
to
the
accumulator
using
the
TXA
instruction.
.
2000
.
2002
.
2004
.
2007
.
2008
.
200A
.
200B
.
200C
.
200E
.
200P
A0
A2
AD
4A
90
E8
88
10
8A
00
07
00
00
21
01
F9
LDY
LDX
LDA
LSR
BCC
IWX
DEY
BPL
TXA
BRK
#$07
#$00
$2100
$200B
$2007
.Y
keeps
track
of
which
bit.
.X
counts
bits set
to
1.
Get
the
value
to
count.
Shift
the
next
bit
into
carry.
If clear,
skip
the
next
instruction.
Increment
the
count
of
bits
set
to
1
Decrement
which
bit.
If
not
done,
go
on.
Transfer
the
count
to
.A
for
future
use.
Stop
processing.
The
value
of
$2100
may
be
altered
using
the
M
(Memory)
command.

Other manuals for Commodore Plus 4

Related product manuals