EasyManua.ls Logo

Commodore Plus 4 - Page 282

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...
270
Machine
Language
on
the
Commodore
Plus/4
.
2008
85
D8
STA
$D8
Store
in
the
low
byte
of the
originating
address.
.
SOOA
A9
28
LDA
#$28
Load
.A
with
the
low
byte
of
the
second
line
address.
.
200C
85
DA
STA
$DA
Store
in
the
low
byte
of the
destination
address.
.
200E
AO
27
LDY
#$27
Initialize
.Y
to
move
one
line.
.
2010
Bl
D8
LDA
($D8),Y
Get
the
character
from
the
first
line.
.
2012
91
DA
STA
($DA),Y
Put
on
the
second
line.
.
2014
88
DEY
Decrement
the
index
register.
.
2015
10
F9
BPL
$2010
If
not done,
go
on.
.
2017
00
BRK
Stop
processing.
If
the
screen
scrolls
upon
execution
of
the
BRK
instruction,
the
effect
of
the
program
will
not
be
seen.
To
avoid
this,
clear
the
screen
before
executing
the
program.
LSR—Shift
Right
One
Bit
Each
bit
in
the
specified
operand
is
shifted
one
bit
to
the
right.
The
low
bit
is
shifted
into
the
carry
flag,
and
a
0
is
shifted
into
the
high
bit.
Operation:
0
[7
0]-+C
Flags
Affected:
N,
Z, C,
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Accumulator
Zero
page
Zero
page,
X
Absolute
Absolute,
X
LSR
LSR
$hh
LSR
$hh,X
LSR
$hhhh
LSR
$hhhh,X
4A
46
56
4E
5E
1
2
2
3
3
2
5
6
6
7
Bit
0
of
the
operand
is
shifted
into
the
carry
flag.
Bits
7
through
1
are
shifted
into
bits
6
through
0,
respectively.
Since a
0
is
shifted
into
the
high
bit,
the
result
can
never
be
negative.
Hence,
the
N
flag
is
always
cleared
to
0.
If
the
result
is
zero,
the
Z
bit
is
set
to
1;
otherwise
it
is
cleared
to
0.
Example:
This
program
counts
the
number
of
bits
set
to
1
in
memory
location
$2100.
The
LSR
instruction
is
used
to
shift
the
bits
one
by
one
into
the
carry
bit
for
testing.
.
2000
AO
07
LDY
#$07
.Y
counts
the
8
bits.
.
2002
A2
00
LDX
#$00
.X
counts
the
number
of
bits
set
to
1.
.
2004
AD
00
21
LDA
$2100
Get
the
byte
to
count.
.
2007
4A
LSR
Shift
bit
0
into
the
carry.

Other manuals for Commodore Plus 4

Related product manuals