Guardian Application Conversion Guide
General-Case Variances
Converting to TNS/R Systems
9–4 096047 Tandem Computers Incorporated
For example, the results of the following operations are undefined:
INT trap_p = 'L' - 2; !Location of the P register
trap_p := trap_p '+' 1; !Undefined
trap_p := trap_p '-' 1; !Undefined
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 application
program where execution is to begin if a trap occurs. You do not need to change
ARMTRAP (-1,-1) calls that cause programs to abend on traps.
For more guidelines on writing trap handlers, see “Trap Handlers That Use the
Register Stack” earlier in this section.
Privileged Instructions TOTQ and RCPU are currently nonprivileged instructions on TNS processors; they
are privileged instructions on TNS/R processors.
TOTQ Test the out queue
RCPU Read the CPU number
Remove these instructions from nonprivileged programs. On TNS/R systems,
nonprivileged programs that use these instructions fail with an Instruction Failure
exception.
Nonprivileged References
to System Global Data
Only privileged programs can access system global data. When a nonprivileged
program references system global data, results differ depending on the system:
On TNS processors, the program accesses the user global data segment instead.
On TNS/R processors, the program fails with an Instruction Failure exception.
Use a text editor to search for ‘SG’ in nonprivileged programs and remove references
to system global data from nonprivileged programs.
The following nonprivileged procedure references the system data at SG[0].
INT cpuno = 'SG' + 0; !SG equivalencing
INT .EXT xcpuno; !Extended pointer
PROCEDURE foo; !Nonprivileged procedure
BEGIN
IF cpuno = 1 THEN !TNS/R system traps
BEGIN !TNS system accesses G[0]
!Lots of code
END;
@xcpuno := $XADR(cpuno);
IF xcpuno = 1 THEN !TNS/R system traps
. . . !TNS system accesses G[0]
END;