EasyManua.ls Logo

Commodore Plus 4 - Page 293

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
6802
Microprocessor
281
Example:
This
program
places
the
processor
into
decimal
mode
using
the
SED
instruction
and
adds
the
contents
of
$2100
and
$2101.
The
result
is
placed
in
$2102,
and
decimal
mode
is
terminated.
2000
2001
2002
2005
2008
200B
200C
F8
18
AD
6D
8D
D8
00
00
01
02
21
21
21
SED
CLC
LDA
ADC
STA
OLD
BRK
$2100
$2101
$2102
Put
the
processor
into
decimal
mode.
Prepare
to
add.
Get
the
first
decimal
value.
Add
the
second
decimal
value.
Store
the
result.
Exit
decimal
mode.
Stop
processing.
Use
the
M
(Memory)
command
to
examine
and
change
the
contents of
$2100-$2102
to
experiment
with
decimal
mode
addition.
SEI—Set
Interrupt
Disable
Flag
The
interrupt
disable
flag
is
set
to
prevent
interrupts
from
occurring.
Operation:
1
-*
I
Flags
Affected:
I
Addressing
Mode
Syntax
Opcode
Bytes
Cycles
Implied
SEI
78
1
2
This
instruction
sets
the
I
flag
of
the
microprocessor
status
register.
When
this
flag
is
set,
maskable
interrupts
do
not
occur.
The
interrupt
caused
by
the
BRK
instruction
cannot
be
prevented
in
this
way.
Example:
This
example
alters
the
IRQ
vector.
Before
executing
it,
check
the
default
contents
of
$0314-$0315
with
the
M
(Memory)
command.
The
low
byte of
the
default
address
for
IRQ
processing
is
located
in
$0314
and
the
high
byte
in
$0315.
If
this
address
is
not
$CE0E,
replace
the
$CE0E
in
the
program
with
it.
.
2000
78
SEI
Disable
maskable
interrupts.
.
2001
A9
OD
LDA
#$0D
Get
the
low
byte
of
the
address
of
the
new
IRQ
processor.
.
2003
8D
14
03
STA
$0314
Store
in
the
vector.
.
2006
A9
20
LDA
#$20
Get
the
high
byte
of
the
address
of
the
new
IRQ
processor.
.
2008
8D
15
03
STA
$0315
Store
in
the
vector.
.
200B
58
CLI
Reenable
maskable
interrupts.

Other manuals for Commodore Plus 4

Related product manuals