166Bug Generalized Exception Handler - Motorola MVME166IG/D2 Installation Manual

Motorola laptop user manual
Table of Contents

Advertisement

The following is an example of an exception handler which can pass an
exception along to the debugger:
*
***
EXCEPT - Exception handler
*
EXCEPT
SUBQ.L
LINK
MOVEM.L
:
: decide here if your code handles exception, if so, branch...
:
MOVE.L
MOVE.W
AND.W
MOVE.L
MOVEM.L
UNLK
RTS

166Bug Generalized Exception Handler

The 166Bug has a generalized exception handler which it uses to handle all of
the exceptions not listed in Table 4-2. For all these exceptions, the target stack
pointer is left pointing to the top of the exception stack frame created. In this
way, if an unexpected exception occurs during execution of your code, you are
presented with the exception stack frame to help determine the cause of the
exception. The following example illustrates this:
Example:
MVME166IG/D2
Preserving the Debugger Operating Environment
****
#4,A7
Save space in stack for a PC value.
A6,#0
Frame pointer for accessing PC space.
A0-A5/D0-D7,-(SP)
Save registers.
BUFVBR,A0
Pass exception to debugger; Get saved VBR.
14(A6),D0
Get the vector offset from stack frame.
#$0FFF,D0
Mask off the format information.
(A0,D0.W),4(A6)
Store address of debugger exc handler.
(SP)+,A0-A5/D0-D7
Restore registers.
A6
Put addr of exc handler into PC and go.
Bus error at address $F00000. It is assumed for this example
that an access of memory location $F00000 initiates bus error
exception processing.
4
4-15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mvme166

Table of Contents