4-16
Using the 162Bug Debugger
4
Creating a New Vector Table
Your program may create a separate vector table in memory to
contain its exception vectors. If this is done, the program must
change the value of the VBR to point at the new vector table. In
order to use the debugger facilities you can copy the proper vectors
from the 162Bug vector table into the corresponding vector
locations in your program vector table.
The vector for the 162Bug generalized exception handler may be
copied from offset $08 (bus error vector) in the target vector table to
all locations in your program vector table where a separate
exception handler is not used. This provides diagnostic support in
the event that your program is stopped by an unexpected
exception. The generalized exception handler gives a formatted
display of the target registers and identifies the type of the
exception.
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 $80(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 $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