Accelerator Manual (G06.27+, H06.04+, J06.03+)

Preparing Your Program for the Accelerator
Accelerator Manual527303-003
3-5
Passing Parameters in Registers
fragment ending a procedure leaves a value on the register stack, although RP implies
that no value is returned.
PROC Q;
! Lots of code
CODE (LOAD L+3); ! Loads value on stack from data segment
CODE (STRP 7); ! Set RP=7, imply no value returned
CODE (EXIT);
When the PCAL instruction in the following fragment calls procedure Q, it uses the
value left on the register stack.
CODE (PCAL Q);
CODE (STRP 0); ! Set RP=0, use value on stack
CODE (STOR L+4); ! Stores value on stack to data segment
The Accelerator discards the LOAD L instruction, unless you specify ReturnsR0 Q to
tell the Accelerator to preserve that value.