EasyManua.ls Logo

Commodore Plus 4 - Page 276

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...
264
Machine
Language
on
the
Commodore
Plus/4
INX—Increment
the
X
Register
by
1
The
value
currently
in
the
X
register
is
incremented
by
1.
Operation:
X
+
/
-*
X
Addressing
Mode
Syntax
Flags
Affected:
N,
Z
Opcode
Bytes
Cycles
Implied
INX
E8
1
The
value
stored
in
the
X
register
is
increased
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
counts
the
number
of times
the
value
SEA
(the
opcode
for
a
NOP)
occurs
in
the
operating
system
ROM.
The
X
register
is
used
to
count
and
the
INX
instruction
is
used
to
update
it.
.
2000
.
2002
.
2004
.
2005
.
2006
.
2008
.
200A
.
200C
.
200E
.
2010
.
2011
.
2013
.
2015
.
2017
.
2019
A9
85
AA
A8
A9
85
Bl
C9
DO
E8
E6
DO
E6
DO
00
00
D8
80
D9
D8
EA
01
D8
P5
D9
PI
LDA
STA
TAX
TAY
LDA
STA
LDA
CMP
BNE
INX
INC
BNE
INC
BNE
BRK
#$oo
$D8
#$80
$D9
($D8),Y
#$EA
$2011
$D8
$200A
$D9
$200A
Load
.A
with
zero.
Store
zero
in
the
low
byte of
the
address.
Store
zero
in
.X,
the
count
register.
Store
zero
in
.Y,
the
index
register.
Load
.A
with
$80.
Store
$80
in
the
high
byte
of
the
address.
Get
the
value
at
the
current
address.
Compare
with
$EA.
If
not
equal,
go
on.
Increment
the
count
register.
Increment
the
low
byte
of
the
address.
If
not
zero,
go
back
for
the
next
byte
Increment
the
high
byte
of
the
address.
If
not
zero,
go
back
for
the
next
byte
Stop
processing.
When
the
BRK
instruction
is
executed,
the
count
in
the
X
register
is
displayed.

Other manuals for Commodore Plus 4

Related product manuals