Guardian Programmer's Guide

Table Of Contents
Debugging, Trap Handling, and Signal Handling
Guardian Programmer’s Guide 421922-014
25 - 13
Exiting a Trap Handler
Exiting a Trap Handler
Once you have processed the trap condition, you might want to exit from your trap
handler and return to your application. To do this, you need to reissue the ARMTRAP
procedure call with the traphandlr-addr parameter set to zero:
TRAPHANDLR^ADDR := 0;
TRAPSTACK^ADDR := $LMIN(LASTADDR, %77777) - 500;
CALL ARMTRAP(TRAPHANDLR^ADDR,
TRAPSTACK^ADDR);
Calling ARMTRAP in this way restores all register values (including the stack registers)
to what they were when the trap occurred. The ARMTRAP procedure uses the values
saved in locations ‘L’ [-6] through ‘L’ [8] to achieve this. This call to ARMTRAP
normally rearms the trap handler using the same traphandlr-addr. Refer to the
description of ARMTRAP in the Guardian Procedure Calls Reference Manual for
details.
Figure 25-2. Trap Handler Data Stack After Storage Allocation
VST116.VSD