1. How the macro is processed using two passes?
Pass 1: processing of definitions
Pass 2:actual-macro expansion.
2. Give the advantage of line by line processors.
It avoids the extra pass over the source program during assembling.
It may use some of the utility that can be used by language translators so that can be loaded once.
3. What is meant by line by line processor?
This macro processor reads the source program statements, process the statements and then the output lines are passed to the language translators as they are generated, instead of being written in an expanded file.
4. Give the advantages of general-purpose macro processors.
The programmer does not need to learn about a macro facility for each compiler.
Overall saving in software development cost and maintenance cost.
5. What is meant by general-purpose macro processors?
The macro processors that are not dependent on any particular programming language, but can be used with a variety of different languages are known as general purpose macro processors. Eg. The ELENA macro processor.
6. What are the important factors considered while designing general purpose macro processors?
comments
grouping of statements
tokens
syntax used for macro definitions
7. What is the symbol used to generate unique labels?
$ symbol is used in macro definition to generate unique symbols. Each macro expansion the $ symbol is replaced by $XX, where XX is the alpha numeric character.
8. How the nested macro calls are executed?
The execution of nested macro call follows the LIFO rule. In case of nested macro calls the expansion of the latest macro call is completed first.
9. Mention the tasks involved in macro expansion.
identify the macro calls in the program
the values of formal parameters are identified
maintain the values of expansion time variables declared in a macro
expansion time control flow is organized
determining the values of sequencing symbols
expansion of a model statement is performed
10. How to design the pass structure of a macro assembler?
To design the structure of macro-assembler, the functions of macro preprocessor and the conventional assembler are merged. After merging, the functions are structured into passes of the macro assembler.
No comments:
Post a Comment