Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
lynplexs:tutorial:c02 [2011/01/29 12:34]
127.0.0.1 external edit
lynplexs:tutorial:c02 [2014/05/25 18:21] (current)
Line 1: Line 1:
-====== Running ​Programs ======+====== Running ​LynPlexS ​Programs ======
  
 ===== Objectives: ===== ===== Objectives: =====
Line 5: Line 5:
 Having read this section you should be able to: Having read this section you should be able to:
  
-  * Edit, link and run your programs ​+  * Edit, link and run your LynPlexS ​programs ​
  
  
  
-This section is primarily aimed at the beginner who as no or little experience of using compiled languages. We cover the various stages of program development. ​The basic principles of this +This section is primarily aimed at the beginner who as no or little experience of using compiled languages. We cover the various stages of program development. ​
-section will apply to what ever C compiler you choose to use, the stages are nearly always the same+
  
  
 ===== The Edit-Compile-Link-Execute Process: ===== ===== The Edit-Compile-Link-Execute Process: =====
  
- +Developing a program in a compiled language such as LynPlexS ​requires at least four steps: ​
- +
-Developing a program in a compiled language such as requires at least four steps: ​+
  
   - editing (or writing) the program ​   - editing (or writing) the program ​
Line 24: Line 21:
   - executing it    - executing it 
  
-We will now cover each step separately. 
  
  
 ===== Editing: ===== ===== Editing: =====
 +You write a computer program with words and symbols that are understandable to human beings. This is the edit part of the development cycle. You type the program directly into a window on the screen and save the resulting text as a separate file. This is often referred to as the source file (you can read it with the TYPE command in DOS or the cat command in unix).
  
- +The custom is that the text of a LynPlexS ​program is stored in a file with the extension ​//.pls//.
-You write a computer program with words and symbols that are understandable to human beings. This is the edit part of the development cycle. You type the program directly into a +
-window on the screen and save the resulting text as a separate file. This is often referred to as the source file (you can read it with the TYPE command in DOS or the cat command in unix). +
- +
-The custom is that the text of a program is stored in a f ile with the extension .c for C programming language +
  
 ===== Compiling: ===== ===== Compiling: =====
- +You cannot directly execute the source file. To run on any computer system, the source file must be translated into binary numbers understandable to the computer'​s Central Procesing Unit (for example, the 80*87 microprocessor). This process produces an intermediate object file - with the extension ​//.obj//, the //.obj// stands for //object//.
- +
-You cannot directly execute the source file. To run on any computer system, the source file must be translated into binary numbers understandable to the computer'​s Central Procesing Unit +
-(for example, the 80*87 microprocessor). This process produces an intermediate object file - with the extension .obj, the .obj stands for Object. +
- +
  
 ===== Linking: ===== ===== Linking: =====
- +The first question that comes to most peoples minds is "Why is linking necessary?" ​The main reason is that many compiled languages come with library ​routines ​which can be added to your program. Theses routines are written by the manufacturer of the compiler to perform a variety of tasks, from input/​output to complicated mathematical functions. ​ After linking the file extension is .exe which are executable files.
- +
- +
-The first question that comes to most peoples minds is Why is linking necessary? The main reason is that many compiled languages come with library ​rountines ​which can be added to your +
-program. Theses routines are written by the manufacturer of the compiler to perform a variety of tasks, from input/​output to complicated mathematical functions. ​In the case of C the standard +
-input and output functions are contained in a library (stdio.h) so even the most basic program will require a lib rary function. ​After linking the file extension is .exe which are executable +
- +
-files. +
  
 ===== Executable files: ===== ===== Executable files: =====
 +Thus the text editor produces //.pls// source files, which go to the compiler, which produces //.obj// object files, which go to the linker, which produces //.exe// executable file. 
  
- +You can then run //.exe// files as you can other applications,​ simply by typing their names at the DOS prompt or run using windows menu. 
-Thus the text editor produces .c source files, which go to the compiler, which produces .obj object files, which go to the linker, which produces .exe executable file. You can then run +
-.exe files as you can other applications,​ simply by typing their names at the DOS prompt or run using windows menu.  +
  
 ===== Using Microsoft C: ===== ===== Using Microsoft C: =====
Line 83: Line 60:
  
 ===== Unix systems: ===== ===== Unix systems: =====
- +The University'​s central irix Service is a Silicon Graphics Inc. Challenge XL system which runs a Unix-like operating sysem called IRIX. The basic information to run a C program on this system is covered in document HT.SI.05 - How To... Run C Programs On The irix Service. Although this document refers to the IRIX operating system many of the command options will be common to all Unix systems. ​
- +
-The University'​s central irix Service is a Silicon Graphics Inc. Challenge XL system which runs a Unix-like operating sysem called IRIX. The basic information to run a C program on this system is covered in document HT.SI.05 - How To... Run C Programs On The irix Service. Although this document refers to the IRIX operating system many of the command options will +
-be common to all Unix systems. ​+
  
 On all Unix systems further help on the C compiler can be obtained from the on-line manual. Type  On all Unix systems further help on the C compiler can be obtained from the on-line manual. Type 
Line 114: Line 88:
 |< 100% 35% - 28% - 35% >| |< 100% 35% - 28% - 35% >|
 | <= [[c01]] ​ ^ |  [[start]] ​ ^ |  [[c03]] => | | <= [[c01]] ​ ^ |  [[start]] ​ ^ |  [[c03]] => |
 +

lynplexs/tutorial/c02.1296304445.txt.gz · Last modified: 2014/05/25 18:21 (external edit)