Object Code Accelerator Manual

Preparing Programs for Acceleration
Object Code Accelerator Manual528144-003
3-8
Non-Standard Procedure Call or Return RP Values
Use the OCA RETURNVALSIZE option to specify the correct return values.
For procedures with one return value size, specify:
RETURNVALSIZE procedure-name value
where procedure-name is the name of the procedure, and value is the number
of 16-bit words returned by the procedure. Use this option for functions whose
return values cannot be declared in TAL, such as 48-bit integers. You can also
use this option for C functions that return the type “void *” or return a struct by
value. Specify 1 word for NOXMEM (small-memory model) and 2 words for
XMEM (large-memory model).
For procedures with more than one possible return value size (depending on
the exit taken from the procedure), specify:
RETURNVALSIZE procedure-name UNKNOWN
where procedure-name is the name of the procedure, and UNKNOWN tells
OCA to check the return value size for each procedure call. Use this option for
functions where the number of words returned is dependent upon run-time
logic.
Examples
The declared size of a function (procedure or subprocedure) return result value in
the Binder region must match the actual return size or OCA generates incorrect
code. The following TAL procedure returns three words implicitly and two words
explicitly.
INT(32) PROC foo; ! Actually returns INT48
BEGIN
INT tag;
INT(32) value;
STACK 1; ! Put value on stack when not defined
?RP=7 ! Lie to TAL, suppress warning
RETURN 2d; ! Defined return value, does not match
! value returned on the stack
END;
This shows how the TAL compiler view of the register stack differs from the actual
run-time register stack. The TAL compiler believes that the register stack is empty