Guardian Application Conversion Guide
General-Case Variances
Converting to TNS/R Systems
096047 Tandem Computers Incorporated 9–3
General-Case
Variances
The following variances apply to all object files (whether accelerated or not) that you
are running on a TNS/R system:
Trap handlers that use the register stack
Trap handlers that use the program counter
Privileged instructions
Nonprivileged references to system global data
Stack wrapping
Odd-byte references
Data swap file size
Passing the address of P-relative objects
Shift instructions with dynamic shift counts
Trap Handlers That
Use the Register Stack
During program execution, the trap mechanism handles all error and exception
conditions not related to input or output. User-written trap handlers differ on TNS
and TNS/R systems as follows:
On TNS systems, trap handlers can be functions and they can change the register
stack (registers R0 through R7).
On TNS/R systems, the reported register stack contents are imprecise. Trap
handlers must not be functions and they can reliably change only certain registers.
The trap handlers, however, can:
Print error messages and abend
Clear overflow and resume
Resume after a loop timer
Jump to a restart point by changing the trap variables P, L, ENV, space ID, and
S
Within a trap handler, you can put values into global variables. You can also save
the register stack contents (although imprecise) as follows:
CODE (PUSH %777); !Save register stack contents
Change your programs to comply with the preceding restrictions. Find trap handlers
by looking for calls to the system procedure ARMTRAP with parameters (address of
label, address of data area). ARMTRAP specifies an entry point into the program
where execution is to begin if a trap occurs. You need not change ARMTRAP (-1,-1)
calls that cause programs to abend on traps.
Trap Handlers That
Use the Program Counter
The reported program counter register, P, is imprecise for all code. Do not rely on the
value of P to determine program flow or to calculate the target of a jump.
You can change the P trap variable to a valid restart point (such as a cleanup point in
the outer block). When doing so, you can make changes that are consistent with this to
ENV and the space ID. However, do not perform arithmetic on P.