EasyManua.ls Logo

Commodore Plus 4 - Page 260

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...
248
Machine
Language
on
the
Commodore
Plus/4
Operation:
Branch
on
Z-
1
Flags
Affected:
None
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Relative
BEQ
$hhhh
FO
2 2*
*
Add
1
cycle
when
the
branch
is
taken.
Add
2
cycles
when
it
is
taken
across
a
page
boundary.
Example:
In
this
example,
the
BEQ
instruction
is
used
to
cause
the
program
to
continue
looping
until
a
key
is
hit.
.
S000
20
E4
FP
JSR
$FFE4
Call
the
ROM
subroutine
to
look
for
input.
.
2003
FO
FB
BEQ
$2000
If
zero
is
returned,
then
there
is
no
input,
so
look
again.
.
2005
00
BRK
Stop
processing.
BIT—Test
Bits
in
Memory
with
Accumulator
Bits
6
and
7
of
the
operand
are
transferred
to
the
V
and
N
flags.
The
values
in
the
accumulator
and
the
operand
are
logically
ANDed,
and
a
zero
result
is
indicated
in
the
Z
flag.
Neither
the
value
in
the
accumulator
nor
in
the
operand
is
altered.
Operation:
A
AM
Flags
Affected:
N,
Z,
V
M7-N
M6-V
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Zero
page
BIT
$hh
24
2
3
Absolute
BITShhhh 2C
3
4
If
bit
7
is
set
to
1
in
the
specified
memory
location,
then
the
N
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
If
bit
6
is
set
to
1
in
the
specified
memory
location,
then
the
V
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
If
the
result
of
ANDing
the
value
in
the
accumulator
with
the
value
in
the
specified
memory
location
is
0,
the
Z
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
The
values
stored
in
the
accumulator
and
the
memory
location
are
not
changed.
Example:
The
BIT
instruction
is
particularly
useful
when
information
is
required
about
some
memory
location,
but
the
value
in
the
accumulator
must
be
preserved.
The
example
counts
the
number
of
bits
set
to
1
in
the
value
stored
at
$2100.
The
accumulator
keeps
track
of
which
bit
it
is
on.
.
2000
A2
00
LDX
#$00
.X
will
contain
the
bit
count.

Other manuals for Commodore Plus 4

Related product manuals