Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual—522629-013
2-37
ARMTRAP Procedure
(Superseded by SIGACTION_INIT_ Procedure )
'L'[-2] New value for P register
'L'[-1] New value for hardware ENV register
'L'[0] New value for L register
'L'[1] New value for R0
'L'[2] New value for R1
'L'[3] New value for R2
'L'[4] New value for R3
'L'[5] New value for R4
'L'[6] New value for R5
'L'[7] New value for R6
'L'[8] New value for R7
Note that parts of ‘L’[-5] and ‘L’[-1] are combined into the new space ID.
Considerations
•
Space required for a trap handler
Typically the
trapstack-addr value activates the trap handler near the high end
of the process stack. At least 350 words must be available between the trap
address value specified to ARMTRAP and either the last word in the application’s
data area or ‘G’[32767], whichever is less. Alternatively, stack space for the trap
handler can be allocated among the process global variables, below the stack.
•
Saving the register stack and allocating local data
Upon entry to the application process’s trap handler, the stack registers (R0-R7)
contain the values they had at the time of the trap. To save these values, the first
statement of the trap handler must be:
CODE ( PUSH %777 )
This saves the register stack contents. Local storage can then be allocated by
adding the appropriate value to ‘S’ through a statement of the form:
CODE ( ADDS num-locals )
where num-locals is a LITERAL defining the number of words of local storage
needed (see the next consideration).