Object Code Accelerator Manual
Preparing Programs for Acceleration
Object Code Accelerator Manual—528144-003
3-4
Passing Parameters in Registers
•
The procedure calls the Debug process.
Required Changes
•
If a called procedure inherits registers from a calling procedure, you must use the
INHERITSR option to specify the registers that are passed by the calling
procedure.
INHERITSRn procedure-name
where n = 0, 1, 2, …, 7, (the register number) and procedure-name is the name of the
called procedure.
OCA emits a warning for called procedures that might inherit registers.
•
If a called procedure returns registers to a calling procedure, you must use the
RETURNSRn option to specify the registers that are returned by the called
procedure.
RETURNSRn procedure-name
where n = 0, 1, 2, …, 7, (the register number) and procedure-name is the name of the
called procedure.
Make sure you specify the correct procedure. OCA emits Warning 15 for calling
procedures that might inherit registers that are returned from a procedure they call.
You must specify the called procedure in the ReturnsR option.
Examples
Figure 3-1 on page 3-6 shows the passing of parameters in registers coded with the
USE statement. Procedures can also pass parameters in registers by using TAL CODE
statements. For example, the following fragment ending a procedure leaves a value on
the register stack, although RP implies that no value is returned.
PROC Q;
! Lots of code
Note. The library function CLIB^EXTFNAME^TO^INTFNAME contains an uninitialized register vari-
able in C30
versions of the HP C library released before 01DEC90. When this is the case, OCA
generates incorrect code; a program might cause a run-time trap or overwrite user variables.
To get a correctly accelerated program, you must do either a full or replacement bind of the
library and then accelerate the program again. To do a replacement bind, enter the following
commands in Binder:
1. ADD * FROM object-file
2. ADD CODE CLIB^EXTFNAME^TO^INTFNAME FROM C-library, DELETE
3. BUILD object-file
Note. HP strongly recommends that you remove this coding practice from your programs
because it will not be supported in future software releases.