Motorola MVME147 Installation And Use Manual page 191

Mpu vmemodule
Table of Contents

Advertisement

is added to the address of the Bug target program vector table
(which your program saved), yielding the address of the Bug
exception vector. The program then jumps to the address stored at
this vector location, which is the address of the Bug 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
Bug Generalized Exception Handler
The 147Bug has a generalized exception handler which it uses to
handle all of the exceptions not listed in
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:
Preserving the Debugger Operating Environment
#4,A7
LINK
A6,#0
MOVEM.L A0-A5/D0-D7,-(SP)
:
:
:
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
Save space in stack for a PC value
Frame pointer for accessing PC space
Save registers
Decide here if your code handles exception, if so, branch...
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
Table
B-5. For all these
B
B-37

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents