The Program Creation Process

 < Day Day Up > 



Computers execute binary instructions. These binary instructions are known as machine instructions or machine code. It is difficult to program in machine code and early computer pioneers soon developed an easier way to write programs. The program creation process consists of the following steps:

  • Step 1 - Write the program in a computer language humans can read and understand (like C++),

  • Step 2 - Save the programs in text files. Programs can be a few lines long and reside in one file or can consist of many millions of lines of code and span thousands of files,

  • Step 3 - Run the source code files through a program called a compiler to generate object code for the target computer,

  • Step 4 - Run the object files through a program called a linker to produce an executable image.

These steps are illustrated in figure 2-1 below.

click to expand
Figure 2-1: The Program Creation Process

Two other items of note are shown in figure 2-1. First, C++ adds a preprocessing step to the program creation process. The C++ preprocessor acts upon special instructions that can be contained in the C++ source code. These special preprocessor instructions are called preprocessor directives. You have already been introduced to several important and often used preprocessor directives in chapter 1. These were #include, #ifndef, #define, and #endif.

The second item of interest in figure 2-1 is the assembly code file and assembler step shown at the bottom. Program routines can be created in other languages and compiled into object modules and then later linked with object modules created with C++. This is often referred to as mixed-language programming. (see chapter 18) If you develop routines in other languages you will have to learn some special rules called calling conventions. Calling conventions establish responsibilities of the calling routine and the called routine. Preprocessor directives and mixed-language programming will be discussed in greater detail later in the book.



 < Day Day Up > 



C++ for Artists. The Art, Philosophy, and Science of Object-Oriented Programming
C++ For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504028
EAN: 2147483647
Year: 2003
Pages: 340
Authors: Rick Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net