Assembler and Compiler


Assembler and Compiler


Programming languages are used to develop software. Depending on the problem programmer can select any programming language he/she wishes. What a programming language actually do? Computer can understand only 0s and 1s (binary digits 0=off,1=on) which is known as machine language. To develop software we must interact with computer in the language it knows. But using the machine language to interact with is a very very difficult. In early time programmer use a language to interact with computer to make computer to do a specific job. It is mainly in numerical format[to represent certain task such as addition,multiplication,logical operations etc each of them represented by sequence of number (either binary format or decimal format)]. It too become very hard. Because how many numbers can one remember for a specific task. So we need some solution for that. To interact with computer or make it understand what we are going to instruct it.
The choice is to select a language which can understand both human and the machine. Options are High-level language and Assembly language (or low-level language).

The language we used to interact with computer contains instructions. For example if want to add two numbers 5+2 we first give computer a instruction read first number(here we choose 5) ,next instruction to read second number(2) after that we give the instruction to add these number. Then computer load the number from memory and compute it and result store in to the memory. To get the result we specify the instruction to get the result. Basically every computer perform arithmetic operation(+-*/) logical operation(< > <= => ==), and branch operation for finding or performing any job given to it.

So, as mentioned above, early time programmer use some kind of numerical format to interact with computer. Every instruction has a corresponding numeric codes. As a result there is chance for error. Because programmer need to remember all the codes, which are, in numeric format and also if any number in the instruction has typed wrongly then it will become error and get wrong result, which is very difficult to find and correct. So, programming in machine language is very difficult one and error-prone. To overcome this difficulties there introduce a language called Assembly language.

In assembly language the instructions are specified using alphanumeric mnemonic codes. For example if you want to perform addition you can specify the instruction ADD. Before the introduction of assembly language, programmer need to specify the corresponding numeric codes. it may be like 1110(binary) 14(decimal) for addition in numerical format instruction.

But, computer can't understand what we are saying by using alphanumeric mnemonic codes like ADD,START,SET,FRST,SCND,ANSR etc. The computer knows only machine language. So here we need a converter/Translator. A translator from Assembly language to machine language.!!!!!!!

Assembler do the job of conversion. Assembler take the input from assembly language program(source code) and produce the output as machine language(object code), which is easily understandable by computer.

Listed below is the drawback of Assembly Programming LanguageALP:

  • Machine dependent
  • programmer must have knowledge about internal working of computer
  • somewhat difficult and time consuming
  • Instructions are still at machine language language level
"Due to these limitations Assembly language is also called low-level programming language"

To overcome these limitations, there are High-Level Language(HLL). It have features like:

  • machine independent
  • knowledge about internal working of computer is not necessary
  • human can understand easily

For converting High-level language into machine language there is a translator called Compiler. Compiler takes the input in High-level programming language(or source code), process it and produces Machine language code(aka object code).

No comments: