Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

The programming language which revolutionized building of operating systems in 1980s

The C programming Language became one of the most reliable language for building operating systems for computers in early 1980s. It was fast and programmers have the control over memory, the main reason why programmers chose C over assembly, because of the syntax which made it popular, the syntax of C is user friendly and easy compared to assembly language.

What is C programming?

C is a general purpose programming language which has many features and can give control over the computer's memory. C is not a very high level language, rather it is considered as an low level language. 

Why C was created?

Picture of PDP-11 with a terminal 


Due to the rise of PDP-11, the computer needed operating system which was UNIX, but the Code of UNIX operating system was written in assembly language, which was hard and painful to read. Therefore, Dennis Ritchie started developing the beta version which is known as the "B programming", but the completed version of the language got the name "C programming", a language with simple syntax and easily readable code at that time. 


Features of C

C provides the fundamental control-flow construction which is required for structured programs like.

  • creation of strings, lists, sets, variables, pointers and arrays
  • if-else and switch-case statement  
  • while, do-while, for loops
  • user defined function creation
  • read & write files 
  • memory management statements
  • creation of data structures


Compilation process of C program



The compilation process of a C program has 4 steps preprocessing, compilation, assembling and linking. These steps are important for compiling a C program, "filename.c" is human readable where as "filename.exe" is machine readable. You will find all the information of these steps in brief below. 

Preprocessing

The first step in the compilation processes of C, in this step the comments are removed from the code, macros are expanded from the code, includes the file from "#include" and finally it replaces all the conditional statements with pre-written assembly code. It is stores in the file format "filename.i".

Compilation 

In this step, all the pre-processed code stored in "filename.i" is converted into assembly language. Assembly code is the most low level language after the machine language.

Assembling 

In this step, all the assembly code is converted into machine language in either hexadecimal or binary format, after that every thing is compiled and stored into a object file which cannot be directly run by the computer.

Linking

In this step, object file is linked with the suitable executable file format for specific operating system. For example "filename.exe" for windows, "filename.out" "filename.bin" "filename.bin" "filename.run" for Linux/UNIX.     
 
In this post you have learned about the C program and compilation process of it.


This post first appeared on Velocium, please read the originial post: here

Share the post

The programming language which revolutionized building of operating systems in 1980s

×

Subscribe to Velocium

Get updates delivered right to your inbox!

Thank you for your subscription

×