EasyManua.ls Logo

Commodore Plus 4 - Page 278

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...
266
Machine
Language
on
the
Commodore
Plus/4
Example:
Without
affecting
any
of
the
flags,
the
processing
control
is
passed
to
the
specified
address.
This
is
the
only
instruction
that
has
an
indirect
addressing
mode.
In
this
mode,
the
value
at
the
specified
address
is
used
as
the
low
byte of
the
destination
address,
and
the
value
stored
in
the
next
location
is
used
as
the
high
byte
of
the
destination
address.
In
this
program
the
background
color
is
cycled
through
every
possible
value.
The
JMP
instruction
is
used
to
jump
to
the
reset
routine.
The
reset
routine
restores
the
background
color
to
its
default
value
(and
returns
to
BASIC).
2000
A9
00
LDA
#$00
2002
8D
15
PF
STA
$FF15
2005
EE
15
FF
IMJ
$FF15
2008
FO
OE
200A
A5
A5
200C
29
02
200E
DO
FA
2010
A5
A5
2012
29
02
2014
FO
FA
2016
DO
ED
BEQ
$2018
LDA
$A5
AND
#$02
BETE
$200A
LDA
$A5
AKTD
#$02
BEQ
$2010
BETE
$2005
2018
4C
F6
FF
JMP
$FFF6
Load
.A
with
a
zero.
Store
zero
in
the
background
color
register.
Increment
the
background
color
register.
If
it
has
cycled
around
to
zero,
quit.
Now
wait.
Load
the
value
in
the
jiffy
clock.
Look
at
bit
1.
Wait
until
it
is
off.
Load
the
value
of
the
jiffy
clock.
Look
at
bit
1.
Wait
until
it
is
on.
Done
waiting,
go
back.
Transfer
control
to
the
reset
routine.
JSR—Jump
to
Subroutine
The
current
value of
the
program
counter
(plus
2)
is
pushed
onto
the
stack
for
use
as
the
return
address.
The
address
specified
with
the
instruction
is
transferred
to
the
program
counter,
and
processing
continues
with
the
instruction
located
at
that address.
Operation:
PC
+
2\
,
(PC+1)-PCL
(PC+
2)^
PCH
Addressing
Mode
Syntax
Flags
Affected:
None
Opcode
Bytes
Cycles
Absolute
JSR
$hhhh
20
The
processor
saves
the
return
address
on
the
stack.
The
RTS
instruction
pulls
these
bytes
off
the
stack.
A
JSR
instruction
should
have
a
corresponding
RTS.

Other manuals for Commodore Plus 4

Related product manuals