0
13kviews
State the reason for assembler to be multipass program.

Mumbai University > Computer Engineering > Sem6 > System Programming and Compiler Construction

Marks: 5M

Year: May 2012

1 Answer
3
1.2kviews

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

enter image description here

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).
Please log in to add an answer.