EasyManua.ls Logo

Commodore Plus 4 - Page 272

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...
260
Machine
Language
on
the
Commodore
Plus/4
.
SOOD
FO 08
BEQ
$8017
If
the
desired
value
is
found,
quit.
.
SOOP
C6
D8
DEC
$D8
Decrement
the
low
byte
of
the
indirect
address
by
1.
.2011
DO
F8
BITE
$200B
If
not
zero,
go
back.
.
2013
C6
D9
DEC
$D9
When
the
low
byte
is
zero,
decrement
the
high
byte.
.
2015
DO
F4
BITE
$200B
If
not
zero,
go
back.
.
2017
00
BRK
Stop
processing.
The
address
of
the
last
occurrence
of
an
$EA
is
stored
in
$D8-$D9
following
the
execution
of
this
program.
DEX—Decrement
the
X
Register
by
1
The
value
currently
in
the
X
register
is
decremented
by
1.
Operation:
X
-
1
X
Flags
Affected:
N,
Z
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Implied
DEX
CA
1
2
The
value
stored
in
the
X
register
is
decreased
by
1.
If
the
result
is
negative,
the
N
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
If
the
result
is
zero,
the
Z
flag
is
set
to
1;
otherwise
it
is
cleared
to
0.
Example:
This
program
copies
contents
of zero
page
into
$2100-$21FF.
The
X
register
is
used
as
the
index.
The
DEX
instruction
is
used
to
update
the
index
value.
.
2000
A2
00
LDX
#$00
Initialize
.X
to
zero.
.
2002
B5
00
LDA
$00,X
Get
a
value
from
zero
page.
.
2004
9D
00
21
STA
$2100,X
Store
the
value
in
$2100-$2IFF.
.
2007
CA
DEX
Decrement
the
index
by
1.
.
2008
DO
F8
BWE
$2002
If
not
equal
to zero,
go
back.
.
200A
00
BRK
Stop
processing.
The
operating
system
uses
many
zero
page
locations,
so
using
an
M
(Memory)
command
to
examine
zero
page
from
the
monitor
may
not
reveal
the
contents
of
zero
page
while
a
program
is
executing.
A
routine
similar
to
the
preceding
one
can
be
used
in
a
program
to
transfer
the
contents
of
zero
page
to
a
safe
location
prior
to
returning
to
the
monitor.

Other manuals for Commodore Plus 4

Related product manuals