C/C++ Programmer's Guide (G06.25+)

HP C/C++ Programmer’s Guide for NonStop Systems429301-008
19-1
19
Running and Debugging C and C++
Programs
Running Programs in the Guardian Environment on page 19-1
Running Programs in the OSS Environment on page 19-2
Program Initialization on page 19-2
Program Termination on page 19-6
Two Memory Models: Large and Small on page 19-7
Two Data Models: 16-Bit and 32-Bit on page 19-9
Selecting Memory and Data Models on page 19-9
Converting Programs to the 32-Bit Data Model on page 19-10
Debugging C and C++ Programs on page 19-11
Running Programs in the Guardian
Environment
When you run a C or C++ program, the NonStop operating system creates a new
process from the program file you specify. This new process passes through three
phases of execution:
1. Program initialization: the C and C++ libraries and CRE perform startup tasks.
2. Program execution: the program controls the flow of execution.
3. Program termination: the C and C++ libraries and CRE perform shutdown tasks.
To run a C or C++ program in the Guardian environment, you use the command
interpreter RUN command. The following diagram shows the general form of the RUN
command; for more detailed information, refer to the TACL Reference Manual.
program-file
is the name of the C or C++ object file you want to run.
run-options
is a comma-separated list of options to the RUN command. Note that this list is
enclosed by slashes (/). Two of the most frequently used RUN options are IN
and OUT.
IN file-name
specifies the standard input file (stdin) for the new process. If you do not
include the IN option, the new process uses the command interpreter's default
input file, which is usually your home terminal.
[RUN] program-file [ / run-options / ] [ args-list ]