EasyManua.ls Logo

Commodore Plus 4 - Page 261

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
249
.
2002
A9
01
LDA
#$01
Start
looking
at
bit
0.
.
2004
2C
00
21
BIT
$2100
See
if
this bit
is
set
in
$2100.
.
2007
FO
01
BEQ
$200A
If
not,
go
on
to
next
bit.
.
2009
E8
INX
Increment
the
bit
count.
.
200A
OA
ASL
Shift
left
to
the
next
bit.
.
200B
90
P7
BCC
$2004
When
carry
is
set,
then
program
is
done.
.
200D
00
BRK
Stop
execution.
The
number
of
bits
set
to
1
in
$2100
is
in
the
X
register
when
the
BRK
instruction
is
executed.
The
contents of
the
registers
are
displayed
when
a
BRK
is
executed
by
the
BRK
instruction
processor.
BMI—Branch.
If
Negative
Flag
Is
Set
This
instruction
examines
the
current
status
of
the
negative
flag
bit.
If
it
is
set
to
1,
the
branch
occurs.
If
it
is
0,
the
branch
does
not
occur,
and
execution
continues
with
the
following
instruction.
Operation:
Branch
on
N
-
1
Flags
Affected:
None
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Relative
BMI
$hhhh
30
2_
2*
*
Add
1
cycle
when
the
branch
is
taken.
Add
2
cycles
when
it
is
taken
across
a
page
boundary.
Example:
In
this
program,
the
locations
from
$2100
to
$217F
that
hold
a
nonnegative
number
are
counted.
The
BMI
instruction
is
used
to
determine
when
a
negative
number
is
encountered
(it is
not
counted).
.Y
counts
the
nonnegative
numbers.
.X
contains
the
pointer
to
the
current
location.
Get
value
of
next
location.
If
it
is
negative,
do
not
count
it.
Count
a
nonnegative
location.
Bump
the
pointer.
If
not
finished,
keep
going.
Stop
processing.
The
count
is
displayed
as
the
contents
of
the
Y
register
when
the
BRK
instruction
is
executed.
.
2000
.
2002
.
2004
.
2007
.
2009
.
200A
.
200B
.
200D
AO
A2
BD
30
08
E8
DO
00
00
80
80
01
P7
LDY
LDX
20
LDA
BMI
IEY
INX
BNE
BRK
#$oo
#$80
$2080,
$200A
$2004

Other manuals for Commodore Plus 4

Related product manuals