EasyManua.ls Logo

Commodore Plus 4 - Page 259

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
6802
Microprocessor
847
Use
the
M
(Memory)
command
to
examine
and
modify
the
contents
of
$2100-52102
before
executing
the
program
(using
G
2000).
Then
check
the
contents
of
$2100-$2102
after
the
program
executes.
The
values
in
$2101-$2102
are
the
sum
of
their
earlier
values
and
the
value
in
$2100.
BCS—Branch
If
Carry
Flag
Is
Set
This
instruction
examines
the
current
status
of
the
carry
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
C-
1
Flags
Affected:
None
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Relative
BCS
$hhhh
B0
2
2*
*
Add
1
cycle
when
the
branch
is
taken.
Add
2
cycles
when
it
is
taken
across
a
page
boundary.
Example:
When
subtracting
a
1-byte
number
from
a
2-byte
number,
you
can
use
standard
double
precision
subtraction,
but
the
operation
may
be
speeded
up
by
using
a
BCS
to
determine
when
to
decrement
the
high
byte.
In
this
example,
the
8-bit
number
stored
at
$2100
is
subtracted
from
the
16-bit
number
stored
at
$2101-$2102
(high
byte
to
low
byte),
and
the
result
is
stored
in
$2101-$2102.
2000
2001
2004
2007
200A
200C
200F
38
AD
ED
8D
BO
CE
00
OS
00
02
03
01
21
21
21
21
SEC
LDA
SBC
STA
BCS
DEC
BRK
$2102
#2100
12102
$200F
12101
Set
carry
flag
prior
to subtraction.
Get
low
byte
of
$2101-$2102.
Subtract
single
byte.
Store
the
result.
If
carry
set,
branch
to
finish.
Otherwise,
decrement
the
high
byte.
Stop
execution.
Use
the
M
(Memory)
command
to
examine
and modify
the
contents
of
$2100-$2102
before
executing
the
program
(using
G
2000).
Then
check
the
contents
of
$2100-$2102
after
the
program
executes.
The
values
in
$2101-$2102
are
the
difference
between
their
earlier
values
and
the
value
in
$2100.
BEQ—Branch
If
Zero
Mag
Is
Set
This
instruction
examines
the
current
status
of
the
zero
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.

Other manuals for Commodore Plus 4

Related product manuals