Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual522629-013
2-41
ARMTRAP Procedure
(Superseded by SIGACTION_INIT_ Procedure )
Invalid trap ENV fields
For a process running in accelerated mode, the ENV field RP is not valid and the
fields N, Z, and K are not reliable.
Register stack R[0:7]
The contents of the TNS register stack are not valid in accelerated mode and are
not dependable in TNS mode. You should never change the register stack when
attempting to resume at the point of the trap.
Functions
A trap-handling procedure must not be a function returning a result value.
OSS Considerations
Do not use the ARMTRAP procedure in OSS processes.
Example
PROC TRAPPROC;
BEGIN
CALL ARMTRAP ( @TRAP, $LMIN ( LASTADDR , %77777 ) - 500 );
! setting the trap.
RETURN;
TRAP:
CODE (PUSH %777);
.
.
.
CALL ARMTRAP ( 0, $LMIN ( LASTADDR , %77777 ) - 500 );
END;
PROC MAIN PROC;
BEGIN
CALL TRAPPROC;
.
.
.
END;
In the previous example, @TRAP is the label at the beginning of the Transaction
Application Language (TAL) trap-handling procedure where control is transferred if a
trap occurs. The $LMIN expression is the address of the local data area where the
trap handler runs (its data area). The second call to ARMTRAP is the return from the
trap handler.
Caution. Use of this procedure in an OSS process causes undefined results and might cause
severe side effects such as disabling signals completely or causing the calling process to
receive a fatal signal.