0% found this document useful (0 votes)
7 views

Compilation and Execution of C Program

The document outlines the compilation and execution process of a C program, detailing the four types of files created: source code file (.c), assembly file (.asm), object file (.o or .obj), and executable file (.exe). Each file serves a specific purpose in the compilation process, from defining the main function to producing a binary executable. The assembler and linker play crucial roles in converting the source code into an executable format.

Uploaded by

shauryavermaa24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Compilation and Execution of C Program

The document outlines the compilation and execution process of a C program, detailing the four types of files created: source code file (.c), assembly file (.asm), object file (.o or .obj), and executable file (.exe). Each file serves a specific purpose in the compilation process, from defining the main function to producing a binary executable. The assembler and linker play crucial roles in converting the source code into an executable format.

Uploaded by

shauryavermaa24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Compilation and Execution of C Program:

Modified Assembly file


Source Code Source Code (abc.asm)
Preprocessor Compiler Assembler
abc.c (abc.c)

Object file
Executable File (abc.obj)
(abc.exe) Linker

Fig: Compilation and execution of C Program

File Created during compilation and execution of C Program


Four types of file created during compiling & executing program such as:
1. Source code file.
2. Assembly file
3. Object file.
4. Executable file.
1. Source code file: The source code file contains the source code of the program. The
extension of any C source code file is ‘.c’. This file defines the main function and may be
other function.
2. Assembly file: It takes the assembly code and produces an assembly listing with offsets.
The assembler output is stored in an object file. The extension of assembly file is ‘.asm’.
3. Object File: Object file are generated by assembler. Object files contain compact binary
code of the function definition. Linker uses this object file to produce an executable file.
Object file have ‘.o’ extension. Although some operating system such as windows and MS-
DOS have ‘.obj’ extension for object file.
4. Executable File: Executable file is generated by linker. Linker combines the various object
file to produce a binary file. The executable file has ‘.exe’ extension.

You might also like