Author :
Craig
Steiner
Source :
8052.com
Important
Interrupt
Consideration:
Register
Protection
One very
important
rule
applies
to all
interrupt
handlers:
Interrupts
must
leave
the
processor
in the
same
state as
it was
in when
the
interrupt
initiated.
Remember,
the idea
behind
interrupts
is that
the main
program
isn’t
aware
that
they are
executing
in the
"background."
However,
consider
the
following
code:
CLR C
;Clear
carry
MOV
A,#25h
;Load
the
accumulator
with 25h
ADDC
A,#10h
;Add
10h,
with
carry
After
the
above
three
instructions
are
executed,
the
accumulator
will
contain
a value
of 35h.
>>>
Enter
here for
detail
on
"Register
Protection" <<<