Following Task of An Assembler

No comments



An Assembler Must do the Following Task  :-

        1.   Generate Instruction :- 
a)     Evaluate the mnemonic in the operation field to produce the machine code.
b)    Evaluate the sub – fields find the value of each symbols, process literals and assign address.
c)     Process pseudo operation.

            2.     Pseudo Operation/Assembler Directives :-  It is an assembly language instructions that specifies an operation of the assembler. It direct the assembler during the assembly process for which no machine code is generate. The directive is a statement which gives direction to the assembler.

 Example :-
Using :- It indicates to the assembler which general register to use as a base and what its contains will be. This is necessary because no special register are set aside for addressing.
    3.   Equation (EQU) :- This pseudo operation allows the programmers to define variables.
Example :-  BASE  EQU  15
                              END
Here if any one wish to use a different base register, He would need only to change the EQU statement.

        4.     START :-  It tells the assembler where the beginning of the program is and               allows the user to give a name to the program.
Example :-  PROGRAMMING  START --> identifies name of a program (PROGRAMMING)

      5.   END :- It tells the assembler where the last cards of programs has been reached.
Example :-
                              i.            LTORG :-  It tells the assembler to place the encountered literals at an earlier location. This pseudo operation is used in the case of a very long program.
                           ii.            ORIGIN :-  It helps in placing the machine code in the specified location while translating the instruction into machine codes by the assembler.

       6.   Forward Reference :-  A forward reference of a program entity is a reference to the entity which precedes its defecation in the program.
While processing a statement containing a forward reference a language processor does not passes all relevant information concerning the referenced entity. This creates difficulties in synthesizing the equivalent largest statement. This problem can be solve by postponing the generation of target code. Until more information becomes available postponing the generation of target code reduce memory requirement of the language processor and simplify its organization.

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀