EasyManua.ls Logo

Commodore Plus 4 - Page 256

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...
244
Machine
Language
on
the
Commodore
Plus/4
contents
of
$2100-$21
OB
after
the
program
executes.
The
values
in
$2108-$21
OB
will
be
the
sum
of
$2100-$2103
and
$2104-52107.
The
carry
flag
is
used
to
transmit
the
carry
information
between
the
bytes.
Before
the
first
ADC,
the
carry
is
cleared,
so
the
first
result
is
correct.
If
a
carry
is
produced,
it
is
automatically
added
into
the
next
byte
because
the
program
does
not
clear
the
carry
before
performing
the
next
ADC.
AND—AKTD
Memory
with
Accumulator
The
value
currently
in
the
accumulator
is
logically
ANDed
to
the
specified
operand,
and
the
result
is
placed
in
the
accumulator.
Operation:
A
A
M
Addressing
Mode
Immediate
Zero
page
Zero
page,
X
Absolute
Absolute,
X
Absolute,
Y
(Indirect,
X)
(Indirect),
Y
A
Syntax
AND
#$hh
AND
$hh
AND
$hh,X
AND
Shhhh
AND
$hhhh,X
AND
$hhhh,Y
AND
($hh,X)
AND
($hh),Y
Flags
Affected:
N,
Z
Opcode
29
25
35
2D
3D
39
21
31
Bytes
2
2
2
3
3
3
2
2
Cycles
2
3
4
4
4*
4*
6
5*
*
Add
1
when
a
page
boundary
is
crossed.
Those
bits
that
are
set
to
1
in
both
the
value
in
the
accumulator
and
the
value
in
the
operand
are
set
to
1
in
the
result.
Bits
that
are
cleared
to
0
in
either
value
are
cleared
to
0
in
the
result.
If
the
result
has
the
high
bit
set
to
1,
the
N
flag
is
set
to
1;
otherwise,
it
is
cleared
to
0.
If
the
result
is
zero,
the
Z
bit
is
set
to
1;
otherwise,
it
is
cleared
to
0.
Example:
The
AND
instruction
is
useful
when
one
or
more
bits
of
a byte
must
be
cleared
to
0
while
the
other
bits
remain
unchanged.
This
example
increments
the
luminance
of
the
screen
without
affecting
the
color
and
times
itself
by
looking
at
a
single
bit
in
the
jiffy
clock timer
on
zero
page.
.
2000
A9
00
LDA
#$00
Start
at
zero
luminance.
.
2002
85
FF
STA
$FP
Save
current
luminance
at
$FF.
.
2004
AD
15
FP
LDA
$FF15
Get
value
of
background
register.
.
2007
29
OF
AMD
#$0F
Do
not
change
the
color
bits.
.
2009
05
FF
0RA
IFF
Put
in
luminance.
.
200B
8D
15
FF
STA
$FF15
Put
value
into
background
register.

Other manuals for Commodore Plus 4

Related product manuals