EasyManua.ls Logo

Commodore Plus 4 - Page 270

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...
288
2008
S009
200B
200D
E8
E0
90
00
20
P5
INX
CPX
BCC
'
BRK
#$20
$2002
Increment
.X
by
1.
Compare
.X
to
$20.
If
.X
is
less
than
$20,
go
back.
Stop
processing.
Use
the
M
(Memory)
command
to
examine
and
change
the
values
in
$2100-$211F.
CFY—Compare
Memory
with.
Y
Register
The
value
currently
in
the
Y
register
is
compared
with
the
specified
operand
and
the
appropriate
flags
are
set.
Operation:
Y-M
Flags
Affected:
N,
Z,
C
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Immediate
Zero
page
Absolute
CPY
#$hh
CPY
$hh
CPY
$hhhh
CO
C4
CC
2
2
3
2
3
4
The
value
in
memory
is
subtracted
from
the
value
in
the
Y
register,
but
neither
value
is
altered.
The
following
table
shows
the
effect
on
each
of
the
flags.
The
N
flag
should
be
used
when
a
two's
complement
compare
is
required
(e.g.,
$FF
is
minus
1
and
less
than
$01).
The
C
flag
should be
used
when
an
unsigned
compare
is
required
(e.g.,
$FF
is
255
and
greater
than
$01).
Condition
N
Flag
Z
Flag
C
Flag
Y<
memory
1
0 0
Y
=
memory
Oil
Y
>
memory
0
0
1
Example:
This
program
copies
the
contents
of
$2100-$21
OF
to
$2110-$211F.
The
Y
register
is
used
as
an
indirect
index
and
an
index.
The
CPY
instruction
is
used
to
determine
when
to
stop
copying.
.
2000
A9
00
LDA
#$00
Load
.A
with
zero.
.
2002
A8
TAY
Load
.Y
with
zero.
.
2003
85
D8
STA
$D8
Store
zero
in
the
low
indirect
address.
.
2005
A9
21
LDA
#$21
Load
.A
with
$21.
.
2007
85
D9
STA
$D9
Store
$21
in
the
high
indirect
address.

Other manuals for Commodore Plus 4

Related product manuals