Assembler
- Assembler is the language translator that accepts inputs as assembly language (ALP) and obtains its machine equivalent code (Object code) along with the information required by the loader.
- ALP is low-level language .The execution of statements can be done line by line.
- Diagram
ALP Machine Language Information for Loader
Reasons for assembler to be Multipass
- Multipass assembler means more than one pass is used by assembler.
- Multipass assembler is used to eliminate forward references in symbol definition.
- Forward References Problem - The assembler specifies the symbols should be declared anywhere in the in the program.
- There may be a chances of using a symbol before its declaration which gives rise to a forward reference problem.
- Due to this problem assembler won’t be able to assemble the instruction and such a problem is called forward references problem
- The solution for forward references problem is having an assembler of two pass.
- It creates a number of passes that is necessary to process the definition of symbols.
- In pass one we find out all the Symbols and Literals.
- And in pass two we will perform assembling of code and the data (generating instruction and generating data).