Why C programming? Assembly language vs Programming Language
Why C Programming Language was created?
A computer can understand only zeroes and ones. Writing instructions in binary code is known as machine language. In the early days, the programmers used to write programs directly in assembly language which in turn converted instructions to machine language using an Assembler. Later, they felt that writing a program in assembly language was a very time-consuming job. So, Programming languages were developed to write code much more easily. Let us know a bit about Assembly Language to understand the purpose of a Programming language.
What is Assembly Language
Assembly languages used simple mnemonic instructions to write a program. These instructions are directly mapped to a sequence of machine language operations. For example:
- MOV R1, R2 - moves the data from register R2 to register R1.
- ADD R1, R2 - add the content of register R1 and R2.
- The assembly language was a considerable improvement over machine language.
- An assembly language program is not portable. Program developed for one type of machine does not work on another type of machine. Hence, an assembler is very specific to a machine.
Why Programming Language
In 1950s and 60s, the high-level and low level programming languages were developed. C is considered a low level programming language relative to other high level languages where memory management is automatic. C give you complete control over the memory. For writing the programs, languages use the mechanism like looping construct - to repeatedly execute the instructions you provide, conditional construct - to execute based on a particular condition and so on. It provides proper structure for a program which makes the user/coder/programmer to understand the progress of the instruction flow.
Programming language divides a large program into number of small modules and each module can do the particular operation and finally these modules are combined together to produce the final result. Program written in such language tend to be relatively portable. That means, program written on one machine can be run on most other machines.
We can write the program using either high-level or low level language. This written program is called source code and is not directly executed on the computer. Instead, the written source code needs to be converted into binary code. This is done by the another translating program such as assembler, compiler or interpreter.