Tuesday 12 February 2013

Draw the flowchart for Pass 1 assembler and explain it.

PASS 1. FLOW CHART
The primary function performed by the analysis phase is the building of the symbol table. For this purpose it must determine the addresses with which the symbol names used in a program are associated. It is possible to determine some address directly, e.g. the address of the first instruction in the program, however others must be inferred.
To implement memory allocation a data structure called location counter (LC) is introduced. The location counter is always made to contain the address of the next memory word in the target program. It is initialized to the constant. Whenever the analysis phase sees a label in an assembly statement, it enters the label and the contents of LC in a new entry of the symbol table. It then finds the number of memory words required by the assembly statement and updates; the LC contents. This ensure: that LC points to the next memory word in the target program even when machine instructions have different lengths and DS/DC statements reserve different amounts of memory. To update the contents of LC, analysis phase needs to know lengths of different instructions. This information simply depends on the assembly language hence the mnemonics table can be extended to include this information in a new field called length. We refer to the processing involved in maintaining the location counter as LC processing.

7 comments:

  1. Great flowchart. I found a great tool for drawing them on the web from Lucidchart. It is an extremely powerful tool and allows real time collaboration. I highly recommend checking it out.

    ReplyDelete
  2. Awesome flowchart.i am very useful your explination..
    and i was get full marks of my final exam.
    thanks a lot.

    ReplyDelete
  3. Congrats bro and thanks for writing to us. You can subscribe to my youtube channel channel for latest tech videos:
    https://www.youtube.com/channel/UCnRCUB8utEFY0xqm7L92yZg

    ReplyDelete