Accelerator Manual (G06.24+, H06.03+)
Preparing Your Program for the Accelerator
Accelerator Manual—527303-002
3-4
Passing Parameters in Registers
•
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)
•
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.
InheritsR n procedure-name
where n = 0, 1, 2, …, 7, (the register number) and procedure-name is the name of the
called procedure.
The Accelerator emits a warning for called procedures that might inherit registers.
•
If a called procedure returns registers to a calling procedure, you must use the
ReturnsR option to specify the registers that are returned by the called procedure.
ReturnsR n 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. The Accelerator emits Warning 34 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, Passing Parameters in Registers, 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
Note. The library function CLIB^EXTFNAME^TO^INTFNAME contains an uninitialized register
variable in C30.00
RVUs of the HP C library released before 01DEC90. When this is the case,
the Accelerator 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.