Explain difference between macro call and macro expansion.
Macro expansion: While a macro name is used along with a set of actual parameters this is replaced through a code generated from its body. Such code is termed as macro expansion. There are two kinds of expansions:
a. Lexical expansion
b. Semantic expansion
Lexical expansion: This means a replacement of character string by the other string during program generation. This is generally used to replace occurrences of formal parameters through corresponding actual ones.
Semantic Expansion: This implies generation of instructions build to the requirements of exact usage. This is characterized by the fact that various uses of a macro can lead to codes that differ in the number, opcodes and sequence of instructions.
The macro definition is located at the starting of the program is enclosed in between a macro header and macro end statement.
A macro statement consists of macro name and parameters
< macro name > { < parameters >}
Macro call: A macro is called through writing the macro name in the mnemonic field of an assembly statement.