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.
A macro definition starts with the pseudo-op MACRO and ends with MEND.
MACRO
Macro_Name [Arguments]
Instruction 1
Instruction 2
Instruction 3
.
.
MEND
Where:
MACRO → Beginning of macro definitionMacro_Name → Name of macroArguments → Optional parametersMEND → End of macro definition