Explain different features of macros with a suitable example. / Explain conditional macro with a suitable example. /Explain advanced macro facilities with suitable examples. / Explain Macro and Macro Expansion with example / Write the structure of a simple macro definition and a corresponding macro call with a suitable example.

Macro and Macro Processor

A Macro is a single instruction that represents a group of instructions written in assembly language. Instead of writing the same set of instructions repeatedly, the programmer can define them once using a macro and use the macro name whenever required.

When the macro name appears in the program, the Macro Processor replaces the macro call with the actual instructions contained in the macro definition. This replacement process is known as Macro Expansion.

Macros help in:

A Macro Processor is a system software that processes macro definitions and performs macro expansion before the assembler translates the program into machine code.


Macro Definition and Macro Call

A macro definition starts with the pseudo-op MACRO and ends with MEND.

General Structure of a Macro

MACRO
Macro_Name [Arguments]
Instruction 1
Instruction 2
Instruction 3
.
.
MEND

Where: