7 votes 7 votes Macro expansion is done in pass one instead of pass two in a two pass macro assembler because _________ Compiler Design gate1992 compiler-design macros easy fill-in-the-blanks + – Kathleen asked Sep 12, 2014 • retagged Apr 18, 2021 by Lakshman Bhaiya Kathleen 1.6k views answer comment Share Follow See 1 comment See all 1 1 comment reply rajoramanoj commented Oct 4, 2017 reply Follow Share plz someone ans this 1 votes 1 votes Please log in or register to add a comment.
2 votes 2 votes Macro Expansion is all about changing the macro definitions to the respective related code while assembler runs through it resolves all the definitions related to it like if write something like the value will get replaced all these svas7246 answered Oct 21, 2021 svas7246 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes in two processor micro processor all the macro definitions are processed during the first pass it self. so macro expansions are done in pass 1 only. manoranjan gr answered Nov 3, 2018 manoranjan gr comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Macro expansion is done in pass one instead of pass two in a two-pass macro assembler because pass one is responsible for generating the expanded source code and identifying the locations of macro calls, while pass two is primarily concerned with generating the final machine code or object code. Here are the main reasons for macro expansion in pass one: Source Code Generation: Pass one focuses on the generation of the expanded source code by substituting the macro calls with their corresponding macro bodies. This process produces an extended source code that includes the actual instructions resulting from macro expansion. Identifying Macro Calls: During pass one, the macro calls are identified and replaced with their macro bodies. The locations of these macro calls and their expanded code are recorded, allowing the assembler to efficiently handle them in pass two. Location Counter Updates: The location counter (LC) is updated in pass one as the macro instructions are expanded. The assembler needs to keep track of the addresses where the macro instructions are expanded to ensure proper addressing in the final output. Parameter Handling: Pass one handles the evaluation of parameters and argument substitution. It ensures that the parameters in the macro body are appropriately replaced by the actual arguments provided in the macro call. rajveer43 answered Dec 30, 2023 rajveer43 comment Share Follow See all 0 reply Please log in or register to add a comment.