Guardian Application Conversion Guide

Converting a TAL Program to Run at a High PIN
Converting TAL Applications
096047 Tandem Computers Incorporated 3–11
Calling the
MYPID Procedure
If a high-PIN process calls MYPID, a trap condition occurs; MYPID cannot return 16
bits to an 8-bit field. Your existing program might call the MYPID procedure to obtain
its CPU and PIN values:
INT cpu^and^pin; ! CPU and PIN values.
...
cpu^and^pin := MYPID; ! Return the CPU and PIN values.
Convert MYPID calls into PROCESSHANDLE_DECOMPOSE_ procedure calls except
when MYPID is called within a SETMODE function 11 call as described under “Using
MYPID in a SETMODE (Function 11) Procedure Call,” the next subsection.
The PROCESSHANDLE_DECOMPOSE_ procedure requires a process handle as an
input parameter. If you do not know the process handle of your process, call the
PROCESSHANDLE_GETMINE_ procedure. Then pass the results to
PROCESSHANDLE_DECOMPOSE_ , which returns the CPU and PIN values as
separate integer values. For example:
INT cpu^number, ! CPU.
pin^number, ! PIN.
process^handle[0:ZSYS^VAL^PHANDLE^WLEN-1];
! Process handle.
...
! Obtain the caller's process handle.
error := PROCESSHANDLE_GETMINE_(process^handle);
... ! Check the error return value.
! Return the caller's CPU and PIN values.
error := PROCESSHANDLE_DECOMPOSE_(process^handle,
cpu^number,
pin^number);
Your program might also specify MYPID as a parameter to another procedure call (for
example, GETCRTPID or PROCESSINFO). See “Getting Information About a High-
PIN Process” later in this section for information about these procedures.