Difficulty: Medium
Correct Answer: All of the above
Explanation:
Introduction / Context:
Macro facilities expand programmer productivity by allowing parameterized text substitution and code generation. Macro processors can be implemented in several ways, and understanding these approaches helps in appreciating assembler design and build performance.
Given Data / Assumptions:
Concept / Approach:
An independent macro processor (one-pass or two-pass) runs before the assembler, outputting expanded code. Alternatively, macro processing can be integrated inside one of the assembler passes, reducing I/O and preserving symbol information more tightly.
Step-by-Step Solution:
1) Identify macro roles: parameter substitution, conditional expansion, repetition.2) Consider pipeline placement: pre-assembler (independent) vs. within assembler.3) Recognize that both one-pass and two-pass macro processors exist.4) Conclude that all listed implementation approaches are valid.
Verification / Alternative check:
Historical assemblers and modern toolchains document macro preprocessors as separate tools or as integrated phases, confirming the multiple viable strategies.
Why Other Options Are Wrong:
Options a, b, and c are each correct on their own, so “None of these approaches” is false. Therefore “All of the above” is the correct comprehensive choice.
Common Pitfalls:
Assuming macros must always be a separate preprocessor; many assemblers integrate macro expansion to support symbol scoping and listing alignment.
Final Answer:
All of the above
Discussion & Comments