Download Print this page

Program Stepping - Intel EV80Cl96KB User Manual

Microcontroller evaluation board

Advertisement

EV80C196KB Microcontroller Evaluation Board User's Manual -35,
Program Stepping
These commands allow stepping through programs one instruction at a time. Be-
tween instructions the iECM-96 commands can be used to check the state of the
variables changed by the instruction to ensure that the program is operating prop-
erly. Stepping through code allows a far more detailed look at what is going on in the
program.
The price that is paid for this detail is that stepping does not occur in real
time; this makes it difficult or perhaps impossible to use on code that is tied to real
time events.
Stepping while interrupts are enabled would be confusing since interrupt service
routines will be stepped through as well as sequential code. iECM-96 avoids this
problem by artificially locking out interrupts while stepping, ignoring the state of the
interrupt enable (El) or interrupt mask.
Super-Stepping
is similar to stepping except that interrupts are not artificially sup-
pressed. Also, an interrupt service routine or a subroutine call (and the body of the
subroutine that is called) is treated as one indivisible instruction by the super-step
command.
This allows the user to ignore the details of subroutines and interrupt
service routines while checking out code. Every time an instruction is "super-
stepped" all the service routines associated with enabled pending interrupts will be
executed.
This may allow limited stepping through code while operating in a concur-
rent environment but the system will not operate in real time. A better approach is to
use the GO command to execute to a specified breakpoint and then step through
the code being tested looking for proper operation.
iECM-96 implements the step operation by using the TRAP instruction. To step over
a given instruction iECM-96 determines all the possible subsequent instructions and
places TRAPS at these locations. After doing this it allows the user's program to
execute until it runs into one of these TRAPS and then restores all of the user code
bytes which were overwritten with TRAPS.
If iECM-96 is to step over a conditional
branch, two possible subsequent instructions exist in the sequential code of the
program.
Any other instruction can only have one "next" instruction.
A TRAP is also
set at location 2080H in case the target is reset during the step.
Super-stepping
is accomplished by setting TRAPS like the STEP except for CALL
instructions which are treated as a special case. During a STEP the iECM-96 will put
the TRAP at the target address of a call; during a super-step the TRAP will be
placed at the instruction following the CALL. Interrupts are suppressed during STEP
(not SS) operations by saving the user's El bit, clearing it before the STEP occurs,
and then restoring it. In order to make sure the instruction which is executed does
not modify the El bit, several instructions (PUSHF, POPF, PUSHA, POPA, DI, El)
are simulated by the iECM-96 software rather than being executed by the target
processor.
The 80C196KB instruction IDLPD is also simulated during STEP to
prevent the target from locking up. The simulation treats the IDLPD as a two byte
NO-OP.
Note that the simulation of instructions only occurs during STEP opera-
tions
During a GO or SS command all instructions are executed by the target.

Advertisement

loading