Microprocessors Questions and Answers – Macros

This set of Microprocessor Multiple Choice Questions & Answers (MCQs) focuses on “Macros”.

1. If a number of instructions are repeating through the main program, then to reduce the length of the program, __________ is used.
a) procedure
b) subroutine
c) macro
d) none of the mentioned
View Answer

Answer: c
Explanation: For a certain number of instructions that are repeated in the main program, when macro is defined then the code of a program is reduced by placing the name of the macro at which the set of instructions are needed to be repeated.

2. The process of assigning a label or macroname to the string is called
a) initialising macro
b) initialising string macro
c) defining a string macro
d) defining a macro
View Answer

Answer: d
Explanation: The process of assigning a label to the string is called defining a macro.

3. A macro within a macro is called
a) macro-within-macro
b) nested macro
c) macro-in-macro
d) none of the mentioned
View Answer

Answer: b
Explanation: A macro may be called from inside a macro. This type of macro is called nested macro.
advertisement
advertisement

4. A macro can be defined as
a) beginning of a program
b) end of a program
c) after initialisation of program
d) anywhere in a program
View Answer

Answer: d
Explanation: A macro can be defined anywhere in a program.

5. A macro can be used as ________
a) in data segment
b) to represent directives
c) to represent statements
d) all of the mentioned
View Answer

Answer: d
Explanation: A macro may be used in data segment and can also be used to represent statements and directives.

6. The end of a macro can be represented by the directive.
a) END
b) ENDS
c) ENDM
d) ENDD
View Answer

Answer: c
Explanation: The ENDM directive marks the end of the instructions or statements sequence assigned with the macro name.

7. Inserting the statements and instructions represented by macro, directly at the place of the macroname, in the program, is known as
a) calling a macro
b) inserting a macro
c) initializing a macro
d) none of the mentioned
View Answer

Answer: a
Explanation: Inserting the statements and instructions at the place of macroname, in the program, is known as calling a macro.
advertisement

8. The time required for execution of a macro is ________ that of the procedure.
a) greater than
b) less than
c) equal to
d) none of the mentioned
View Answer

Answer: b
Explanation: The time required for execution of a macro is less than that of procedure as it does not contain CALL and RET instructions as the procedures do.

9. Which of the following statements is incorrect?
a) complete code of instruction string is inserted at each place, wherever the macroname appears
b) macro requires less time of execution than that of procedure
c) macro uses stack memory
d) macroname can be anything except registers and mnemonics
View Answer

Answer: c
Explanation: Macro does not require stack memory and hence has less time for execution.
advertisement

10. The beginning of the macro can be represented as
a) START
b) BEGIN
c) MACRO
d) None of the mentioned
View Answer

Answer: c
Explanation: The beginning of the macro is represented as macroname followed by the directive MACRO.
SYNTAX: macroname MACRO
EXAMPLE: STRINGS MACRO.

Sanfoundry Global Education & Learning Series – Microprocessors.

Here’s the list of Best Books in Microprocessors.

To practice all areas of Microprocessors, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.