167Bug Generalized Exception Handler - Motorola MVME167 Series Installation Manual

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

Advertisement

*
***
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

167Bug Generalized Exception Handler

The 167Bug has a generalized exception handler which it uses to
handle all of the exceptions not listed in
guarantees that all exceptions have an interrupt handler assigned to
handle it. The handler stops target code execution and displays the
register contents.
The following is an example of a routine which builds a separate
vector table and then moves the VBR to point at it:
*
***
BUILDX - Build exception vector table ****
*
BUILDX MOVEC.L
LEA
MOVE.L
MOVE.W
LOOP
MOVE.L
SUBQ.W
BNE.B
MOVE.L
MOVE.L
MOVE.L
MOVE.L
LEA.L
MOVE.L
MOVEC.L
RTS
END
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.
VBR,A0
Get copy of VBR.
$10000,A1
New vectors at $10000.
$3C(A0),D0
Get generalized exception vector.
$3FC,D1
Load count (all vectors.
D0,(A1,D1)
Store generalized exception vector.
#4,D1
LOOP
Initialize entire vector table
$8(A0),$8(A1)
Copy bus error vector.
$10(A0),$10(A1)
Copy breakpoints vector.
$24(A0),$24(A1)
Copy trace vector.
$BC(A0),$BC(A1)
Copy system call vector.
COPROCC(PC),A2
Get your exception vector.
A2,$2C(A1)
Install as F-Line handler.
A1,VBR
Change VBR to new table.
Table 5-2 on page
5-13. This
5
5-17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents