<s>
A	B-Application
trap	B-General_Concept
flag	I-General_Concept
permits	O
operation	O
of	O
a	B-Application
processor	O
in	O
single-step	O
mode	O
.	O
</s>
<s>
If	O
such	O
a	B-Application
flag	O
is	O
available	O
,	O
debuggers	B-Application
can	O
use	O
it	O
to	O
step	O
through	O
the	O
execution	O
of	O
a	B-Application
computer	B-Application
program	I-Application
.	O
</s>
<s>
When	O
a	B-Application
system	O
is	O
instructed	O
to	O
single-step	O
,	O
it	O
will	O
execute	O
one	O
instruction	O
and	O
then	O
stop	O
.	O
</s>
<s>
The	O
Intel	B-General_Concept
8086	I-General_Concept
trap	B-General_Concept
flag	I-General_Concept
and	O
type-1	O
interrupt	B-Application
response	O
make	O
it	O
quite	O
easy	O
to	O
implement	O
a	B-Application
single-step	O
feature	O
in	O
an	O
8086-based	O
system	O
.	O
</s>
<s>
If	O
the	O
trap	B-General_Concept
flag	I-General_Concept
is	O
set	O
,	O
the	O
8086	B-General_Concept
will	O
automatically	O
do	O
a	B-Application
type-1	O
interrupt	B-Application
after	O
each	O
instruction	O
executes	O
.	O
</s>
<s>
When	O
the	O
8086	B-General_Concept
does	O
a	B-Application
type-1	O
interrupt	B-Application
,	O
it	O
pushes	O
the	O
flag	O
register	O
on	O
the	O
stack	B-Application
.	O
</s>
<s>
The	O
8086	B-General_Concept
has	O
no	O
instruction	O
to	O
directly	O
set	O
or	O
reset	O
the	O
trap	B-General_Concept
flag	I-General_Concept
.	O
</s>
<s>
These	O
operations	O
are	O
done	O
by	O
pushing	O
the	O
flag	O
register	O
on	O
the	O
stack	B-Application
,	O
changing	O
the	O
trap	B-General_Concept
flag	I-General_Concept
bit	O
to	O
what	O
the	O
programmer	O
wants	O
it	O
to	O
be	O
,	O
and	O
then	O
popping	O
the	O
flag	O
register	O
back	O
off	O
the	O
stack	B-Application
.	O
</s>
<s>
The	O
instructions	O
to	O
set	O
the	O
trap	B-General_Concept
flag	I-General_Concept
are	O
:	O
</s>
<s>
Actually	O
you	O
do	O
not	O
use	O
the	O
Trap	B-General_Concept
flag	I-General_Concept
in	O
this	O
way	O
,	O
because	O
you	O
are	O
normally	O
monitoring	O
a	B-Application
program	O
from	O
an	O
Interrupt	B-Application
Service	O
Routine	O
(	O
ISR	O
)	O
.	O
</s>
<s>
To	O
reset	O
the	O
trap	B-General_Concept
flag	I-General_Concept
,	O
simply	O
replace	O
the	O
OR	O
instruction	O
in	O
the	O
preceding	O
sequence	O
with	O
the	O
instruction	O
:	O
</s>
<s>
The	O
trap	B-General_Concept
flag	I-General_Concept
is	O
reset	O
when	O
the	O
8086	B-General_Concept
does	O
a	B-Application
type-1	O
interrupt	B-Application
,	O
so	O
the	O
single-step	O
mode	O
will	O
be	O
disabled	O
during	O
the	O
interrupt-service	O
procedure	O
.	O
</s>
