Motorola MVME177 Installation And Use Manual page 121

Single board computer
Hide thumbs Also See for MVME177:
Table of Contents

Advertisement

It may happen 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., ABORT, your exception handler must read the
vector offset from the format word of the exception stack frame.
This offset is added to the address of the 177Bug target program
vector table (which your program saved), yielding the address of
the 177Bug exception vector. The program then jumps to the
address stored at this vector location, which is the address of the
177Bug 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) Save registers.
:
: 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 Restore registers.
UNLK
A6
RTS
Preserving the Debugger Operating Environment
Save space in stack for a PC value.
Frame pointer for accessing PC space.
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.
Put addr of exc handler into PC and go.
B
B-41

Advertisement

Table of Contents
loading

Table of Contents