Object Code Accelerator Manual

Preparing Programs for Acceleration
Object Code Accelerator Manual528144-003
3-3
Passing Parameters in Registers
Refer to the Trap Handlers That Use the Register Stack on page 2-4 for guidelines on
writing trap handlers.
Detection Guideline
Examine your programs to determine if their trap handlers 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) procedures
that cause programs to abend on traps. Trap handlers are usually small enough in
both size and number to check visually.
Required Change
Change your programs to comply with the preceding restrictions.
Passing Parameters in Registers
When processing a TAL program, OCA assumes that only those registers that contain
an explicit value to pass or return hold meaningful values for procedure calls and
returns. Procedures can pass values implicitly using TNS registers with CODE and
STACK statements or the misuse of USE and DROP statements. A procedure inherits
a register if it is passed a register by a calling procedure. A procedure returns a
register if it returns a register to a calling procedure. To get a correctly accelerated
program in these cases, you must use the INHERITSRn or RETURNSRn options to
specify which registers are used to pass parameters to or from a specified procedure.
For a discussion of TNS registers, refer to the appropriate system description manual.
Detection Guidelines
OCA emits Warning 15 if it suspects that a procedure uses a register that is
implicitly set by another procedure.
Warning 15: Procedure <proc-name> in file <filename> inherits
a register <register-number>
Warning 15 can be a false warning if:
The calling procedure employs a use register and does not drop it before the call.
TAL USE and DROP statements are often used to optimize repetitive references to
localized expressions or iteration variables.
The procedure is not written in TAL. (See Note below for C programs).