EasyManua.ls Logo

Commodore Plus 4 - Page 289

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...
The
6502
Microprocessor
277
RTI—Return
from
an
Interrupt
The
values of
the
SR
and
PC
are
pulled
from
the
stack,
and
processing
continues.
Flags
Affected:
All
Example:
Operation:
SR
t
PC\
PC+
1^
PC
Addressing
Mode
Syntax
Implied
RTI
Opcode
Bytes
Cycles
40
16
This
instruction
is
used
to
end
the
processing
of
an
interrupt.
The
status
register
is
restored
from
the
stack.
Because
an
interrupt
can
occur
only
when
the
I
flag
is
clear,
this
status
register
value
will
have
the
I
flag
cleared.
The
program
counter
is
also
pulled
from
the
stack
and
incremented,
and
processing
continues
at
that
point.
No
other
internal
registers
are
affected.
See
the
section
on
interrupts
for
more
information.
This
example
alters
the
IRQ
vector.
The
normal
interrupt
processing
is
sus
pended.
The
substitute
service
routine
simply
increments
the
border
color.
The
program
must
be
halted
by
pressing
the
reset
button
on
the
right side
of
the
computer.
2000
78
2001
A9
OP
SEI
LDA
#$0F
2003
8D
14
03
STA
$0314
2006
A9
20
LDA
#$20
2008
8D
15
03
STA
$0315
200B
58
CLI
200C 40
OC
20
JMP
$2000
200P
EE
19
PP
IMTC
$FP19
2012
68
PLA
2013
2014
2015
2016
2017
A8
68
AA
68
40
TAY
PLA
TAX
PLA
RTI
Disable
maskable
interrupts.
Get
the
low
byte
of
the
address
of
the
new
IRQ
processor.
Store
in
the
vector.
Get
the
high
byte
of
the
address
of
the
new
IRQ
processor.
Store
in
the
vector.
Reenable
maskable
interrupts.
Infinite
loop.
Increment
the
border
color.
Retrieve
the
value
of
.Y
from
the
stack.
Restore
.Y
to
the
preinterrupt
value.
Retrieve
the
value
of
.X
from
the
stack.
Restore
.X
to
the
preinterrupt
value.
Restore
the
value
of
.A
from
the
stack.
Return
from
the
interrupt.

Other manuals for Commodore Plus 4

Related product manuals