Book: System Software, 3Rd Edition, Pearson Education

Total Page:16

File Type:pdf, Size:1020Kb

Book: System Software, 3Rd Edition, Pearson Education

SYSTEM SOFTWARE

Unit 6: MACRO PROCESSOR

Book: System Software, 3rd Edition, Pearson Education

By Leland L. Beck & Dhanabalachandran Manjula

1) Define i) Macro or Macro instruction. ii) Prototype of a macro. iii) Macro invocation or Macro call. iv) Parameters. v) Arguments. vi) Expanding of a macro. Identify the above in the piece of SIC/XE code below: COPY START 0 RDBUFF MACRO &INDEV, &BUFADR, &RECLTH CLEAR X CLEAR A CLEAR S . . . STX &RECLTH MEND . . MAIN PROGRAM

FIRST STL RETADR. CLOOP RDBUFF F1, BUFFER, LENGTH . . . END 2) Explain with an example, the macro definition and expansion. 3) Is it possible to define macros within the body of another macro? If yes how many passes are required to process such macros using a macro processor? Justify your answer with an example. 4) Which is the datastructure in macro processor algorithm that is used only during the macro invocation? Also explain the other datastructures used in the algorithm. 5) Explain the algorithm for one pass macro processor. 6) Give the machine independent features of macro processor. Explain any one of those features. 7) Consider a program consisting of two series of variables named by the symbols XA1, XA2, XA3, . . . , and XB1, XB2, XB3, ... ,etc. and that there is a macro defined for some processing on these series of the variables above. In this case which macro processor feature would you make use of and see that a single macro is used to process both of the series of variables? Explain 8) What is the disadvantage of implicitly specifying labels in macros? How is it overcome? Explain. 9) What is the disadvantage of specifying the jumps using relative addressing in a macro? How is it overcome? Explain with example. 10) What feature of macro processor allows modifying the sequence of statements generated for a macro expansion, depending on the arguments supplied to macro invocation? Explain with example. 11) Is it possible to use looping constructs in macros? If yes explain the macro-time looping statements. 12) Which is macro processor function that returns as its value the number of members in an argument list? 13) What are positional parameters? Is this type of specifying parameters suitable when there are a large number of parameters? Explain. 14) How is the method of specifying parameters using Keyword Macro Parameters advantageous over that of positional parameters? Explain with example. 15) How are recursive macro expansions handled by macro processor? Explain with an example the various procedures and data structures used in such macro expansion. 16) What kinds of languages are preferred to implement recursive macro expansion? 17) Explain the need for General-Purpose macro processors. Why is it difficult to implement General-Purpose macro processors? 18) Which method is used for combining the macro processing with the language translator? Explain such a macro processor. 19) Is it possible to have closer cooperation between the macro processor and assembler or compiler? If yes, what scheme is used for this? Explain such a macro processor. 20) What are Line-by-Line and Integrated Macro Processors? What are their advantages and disadvantages? 21) What are the various implementations of macro processors available? Explain any one. 22) Explain with example, conditional assembly in MASM Macro Processor. 23) Explain the various macro processing features of the ANSI C programming language. 24) Give an example for general purpose Macro Processor. Explain the same. 25) Explain the usage of the Elena Macro Processor with different languages. 26) Explain the various macro-time variables and macro-time instructions in Elena Macro Processor with example. 27) Explain the macro invocation and expansion in Elena Macro Processor.

Recommended publications