Difficulty: Easy
Correct Answer: All of the above
Explanation:
Introduction / Context:
Macro processors extend assembly or high-level languages by allowing parameterized text substitution. They improve code reuse and readability without runtime overhead.
Given Data / Assumptions:
Concept / Approach:
A macro definition names a template. The macro processor must parse and store definitions, detect invocations, and on each call, expand the template with actual parameters, producing plain source for the subsequent assembler/compiler stage.
Step-by-Step Solution:
Identify macro boundaries (e.g., MACRO/ENDM directives).Build a macro name table and definition table.When a call is encountered, bind formal parameters to actuals.Emit expanded text in place of the call for further translation.
Verification / Alternative check:
Tools like m4 or assembler macro facilities follow this pipeline, and listings will show expanded code replacing macro calls.
Why Other Options Are Wrong:
Options A, B, and C each cover part of the required pipeline; only “All of the above” is complete.Option E is incorrect because macro processing does involve these steps.
Common Pitfalls:
Final Answer:
All of the above.
Discussion & Comments