C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

About This Document
This guide describes the implementation of the C and C++ programming languages for HP NonStop
systems. This guide describes these products:
TNS C compiler in the Guardian and G-series OSS environments.
TNS C preprocessor (Cprep) and TNS C++ translator (Cfront) in the Guardian and G-series
OSS environments.
TNS/R and TNS/E native C and C++ compilers in the Guardian and OSS environments.
TNS/R and TNS/E native C/C++ cross compiler on the PC in NSDEE, ETK and TDS.
TNS C run-time library in the Guardian and G-series OSS environments.
TNS/R and TNS/E native C run-time library in the Guardian and OSS environments.
TNS C++ run-time library in the Guardian and G-series OSS environments.
TNS/R and TNS/E native C++ run-time library in the Guardian and OSS environments.
The term TNS means that a program uses the process, memory, and instruction set architectures
of the HP TNS systems. TNS compilers generate TNS instructions based on complex instruction-set
computing (CISC) technology. The Accelerator takes these TNS instructions and generates
corresponding instructions based on reduced instruction-set computing (RISC) technology; the
Object Code Accelerator takes these TNS instructions and generates corresponding instructions
based on Intel Itanium technology. A TNS process is one that runs in TNS mode or accelerated
mode.
The term TNS/R native means a program uses the process, memory, and instruction set architectures
that are native to RISC processors. The term TNS/E native means a program uses the process,
memory, and instruction set architectures that are native to Intel Itanium processors. The term native
mode means a program uses the process, memory, and instruction set architectures that are native
to either type of processor.
Native object files consist entirely of RISC or Itanium instructions. Unlike TNS processes, native
processes do not maintain TNS architecture-specific constructs. Native mode enables you to write
programs that are fully optimized for TNS/R or TNS/E systems such as NonStop servers.
While native mode offers many benefits, you are not required to convert your programs to native
mode. The G0x and H0x release version updates (RVUs) continue to support the TNS compilers
and tools. You can continue to create and run TNS and accelerated object code and gain some
of the performance benefits provided by code that has been converted to native mode.
When you do mixed language programming, remember these points:
There are three HP compilers for the COBOL language, invoked by six separate commands.
All these compilers implement the 1985 standard known as COBOL85 and are released as
the product HP COBOL85 for NonStop Servers:
The TNS compiler COBOL85 command in the Guardian environment or the cobol
command in the G-series Open System Services (OSS) environment
The TNS/R native compiler NMCOBOL command in the Guardian environment or the
nmcobol command in the OSS environment
The TNS/E native compiler ECOBOL command in the Guardian environment or the
ecobol command in the OSS environment
An older COBOL language standard, the 1974 version, is no longer supported on HP NonStop
servers. Neither that COBOL 74 product nor its Guardian-environment compiler are included
in discussions in this guide unless specifically mentioned.
16