The writing of program in machine language is very difficult,tiresome and boring job for a programmer.Moreover,it is error prone.To solve this problem and to facilitate programmer easily understandable language have been developed.Assembly language is one of them.Programs can easily rememberable symbols are selected for this purpose.For example,ADD for addition,SUB for subtraction,CMP for comparison,etc.Such symbols are known as mnemonics.A program written in mnemonics is called assembly language program.The writing of programs in assembly language is easier and faster as compared to the writing of programs n a machine language.
Assembler
when a program is written in a language other than the machine language of computer,the computer will not understand it.Hence,the programs written in other language must be translated into the machine language of the computer before they are executed.such translation is performed with the aid of software.A program is called an assembler.An assembler.An assembler which runs on a computer for which it produces object codes(machine codes)is called a self assembler (or resident assembler).A less powerful and cheaper computer may not have enough software and hardware facilities for program development and convenient assembly.In such a situation a faster and powerful computer can be used for program development.The program so developed are to be run on smaller computers.For such program development a cross assembler is required.A cross assembler is an assembler that runs on a computer other than that for which it produces machine codes.
One-pass Assembler:
it is an assembler which reads the assembly language programs only once.such assembler must be equipped with some means to assign addresses to the labels used in the assembly language program.
Two-Pass Assembler:
It is an assembler which goes through the assembly language program twice.On the first pass the assembler reads the assembly language program and collects all labels. It assigns addresses to the labels counting their position from the starting address.On the second pass the assembler produces the machine code for each instruction and assign address to each.
No comments:
Post a Comment