Motorola 700 Series Installation And Use Manual page 113

Embedded controller
Table of Contents

Advertisement

It may turn out that your program uses one or more of the exception
vectors that are required for debugger operation. Debugger
facilities may still be used, however, if your exception handler can
determine when to handle the exception itself and when to pass the
exception to the debugger.
When an exception occurs which you want to pass on to the
debugger (i.e.,
vector offset from the format word of the exception stack frame.
This offset is added to the address of the 162Bug target program
vector table (which your program saved), yielding the address of
the 162Bug exception vector. The program then jumps to the
address stored at this vector location, which is the address of the
162Bug exception handler.
Your program must make sure that there is an exception stack
frame in the stack and that it is exactly the same as the processor
would have created for the particular exception before jumping to
the address of the exception handler.
The following is an example of an exception handler which can pass
an exception along to the debugger:
*
***
EXCEPT - Exception handler
*
EXCEPT
SUBQ.L
#4,A7
LINK
A6,#0
MOVEM.L
A0-A5/D0-D7,-(SP)
:
: decide here if your code handles exception, if so, branch...
:
MOVE.L
BUFVBR,A0
MOVE.W
14(A6),D0
AND.W
#$0FFF,D0
MOVE.L
(A0,D0.W),4(A6)
MOVEM.L
(SP)+,A0-A5/D0-D7
UNLK
A6
RTS
Preserving the Debugger Operating Environment
), your exception handler must read the
ABORT
****
Save space in stack for a PC value.
Frame pointer for accessing PC space.
Save registers.
Pass exception to debugger; Get saved VBR.
Get the vector offset from stack frame.
Mask off the format information.
Store address of debugger exc handler.
Restore registers.
Put addr of exc handler into PC and go.
4
4-17

Advertisement

Table of Contents
loading

This manual is also suitable for:

800 seriesMvme162lx

Table of Contents