COBOL Manual for TNS/E Programs (H06.03+)
Calling Other Programs and Routines
HP COBOL Manual for TNS/E Programs—520347-003
23-16
Passing Parameters
HP C++ Function Name Consideration
When a COBOL program calls a function compiled by HP C++, the function definition
must include the extern "C" specification for the function name to be used in its original
form. HP C++, by default, adjusts function names to accommodate generic functions
and class methods. For example, a definition such as:
void EXT(char *p) {}
results in the creation of an entry point called EXT_FPc; however, a definition of the
form:
extern "C" void EXT(char *p) {}
produces an entry point called EXT.
This is true in both the Guardian environment and the OSS environment.
Passing Parameters
Topics:
•
Addressing Modes
•
What HP COBOL Can Pass by Content
•
What HP COBOL Can Pass by Reference
•
What HP COBOL Can Pass by Value.
•
Passing Parameters to COBOL Programs
•
Passing Parameters to Non-COBOL Routines
Addressing Modes
Native programs use 32-bit addressing for all data items. Many HP COBOL items are
byte-addressed. Some data items in other languages are 2-byte addressed. When you
pass a byte-addressed item to a routine that expects a 2-byte-addressed parameter,
the data item must be aligned on a 2-byte boundary; otherwise, problems can arise,
because the called routine is expecting an aligned parameter.
Special registers are not addressable data items. If passed as parameters, they must
be passed by value.










