
Preserving the Debugger Operating Environment
5-17
5
*
*** EXCEPT - Exception handler ****
*
EXCEPT
SUBQ.L
#4,A7
Save space in stack for a PC value.
LINK
A6,#0
Frame pointer for accessing PC space.
MOVEM.L
A0-A5/D0-D7,-(SP)
Save registers.
:
: decide here if your code handles exception, if so, branch...
:
MOVE.L
BUFVBR,A0
Pass exception to debugger; Get saved VBR.
MOVE.W
14(A6),D0
Get the vector offset from stack frame.
AND.W
#$0FFF,D0
Mask off the format information.
MOVE.L
(A0,D0.W),4(A6)
Store address of debugger exc handler.
MOVEM.L
(SP)+,A0-A5/D0-D7
Restore registers.
UNLK
A6
RTS
Put addr of exc handler into PC and go.
167Bug Generalized Exception Handler
The 167Bug has a generalized exception handler which it uses to
handle all of the exceptions not listed in
Table 5-2 on page 5-13
. This
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
VBR,A0
Get copy of VBR.
LEA
$10000,A1
New vectors at $10000.
MOVE.L
$3C(A0),D0
Get generalized exception vector.
MOVE.W
$3FC,D1
Load count (all vectors.
LOOP
MOVE.L
D0,(A1,D1)
Store generalized exception vector.
SUBQ.W
#4,D1
BNE.B
LOOP
Initialize entire vector table
MOVE.L
$8(A0),$8(A1)
Copy bus error vector.
MOVE.L
$10(A0),$10(A1)
Copy breakpoints vector.
MOVE.L
$24(A0),$24(A1)
Copy trace vector.
MOVE.L
$BC(A0),$BC(A1)
Copy system call vector.
LEA.L
COPROCC(PC),A2
Get your exception vector.
MOVE.L
A2,$2C(A1)
Install as F-Line handler.
MOVEC.L
A1,VBR
Change VBR to new table.
RTS
END
Содержание MVME167 Series
Страница 1: ...MVME167 Single Board Computer Installation Guide MVME167IG D4 ...
Страница 6: ......
Страница 106: ...4 28 Debugger General Information 4 ...
Страница 132: ...5 26 Using the 167Bug Debugger 5 ...
Страница 146: ...A 14 Configure and Environment Commands A ...
Страница 152: ...B 6 Disk Tape Controller Data B ...
Страница 160: ...D 6 Troubleshooting the MVME167 Solving Startup Problems D ...
Страница 168: ...E 8 EIA 232 D Interconnections E ...