Author :
Craig
Steiner
Source :
8052.com
As the name implies, an interrupt is some event
which
interrupts
normal
program
execution.
As
stated
earlier,
program
flow is
always
sequential,
being
altered
only by
those
instructions
which
expressly
cause
program
flow to
deviate
in some
way.
However,
interrupts
give us
a
mechanism
to "put
on hold"
the
normal
program
flow,
execute
a
subroutine,
and then
resume
normal
program
flow as
if we
had
never
left it.
This
subroutine,
called
an
interrupt
handler,
is only
executed
when a
certain
event
(interrupt)
occurs.
The
event
may be
one of
the
timers
"overflowing,"
receiving
a
character
via the
serial
port,
transmitting
a
character
via the
serial
port, or
one of
two
"external
events."
The 8051
may be
configured
so that
when any
of these
events
occur
the main
program
is
temporarily
suspended
and
control
passed
to a
special
section
of code
which
presumably
would
execute
some
function
related
to the
event
that
occurred.
Once
complete,
control
would be
returned
to the
original
program.
The main
program
never
even
knows it
was
interrupted.
>>>
Enter
here for
detail
on
"Interrupts" <<<
<<< Click
here to
come
back on
(8051
-
Interrupts)