There are two types of macros:

  • Object-like Macros.
  • Function-like Macros.

What is types of macro in computer?

In general, there are two types of macros: Executive. These macros generate either code or data that is incorporated into the program being assembled. Generally, an executable instruction is generated. Declarative. These macros produce information used by the assembly process while generating code.

What are macros in system programming?

A macro is a sequence of instructions, assigned by a name and could be used anywhere in the program. In NASM, macros are defined with %macro and %endmacro directives.

What are the types of macro substitution?

Macro substitution directives Simple macro substitution. 2. Argumented macro substitution. Where Identifier must be a valid C name and string may be any text.

What is macro in system programming and operating system?

MACRO Definition :- Macro is a unit of specification of program generation through expansion. It is single line abbreviation for group of instructions Typically MACRO is defined at start of program or at end of program.

What is macro with example in system programming?

A macro definition is a named sequence of statements you can call with a macro instruction. When it is called, the assembler processes and normally generates assembler language statements from the definition into the source module. The statements generated can be: Copied directly from the definition.

What is macro substitution and give example?

Macro substitution has a name and replacement text, defined with #define directive. The preprocessor simply replaces the name of macro with replacement text from the place where the macro is defined in the source code. Now we will see the fact through an example.

What are the 2 types of macro expansion?

MACRO EXPANSION :-

  • MEC ( Macro Expansion Counter ) :- This is used inside definition of MACRO. MEC is get incremented till MEND.
  • While performing MACRO expansion this MEC is used.
  • Macro expansion will replace macro call by macro model statements and all formal parameters are replaced by actual parameters.

What are macros in Python?

Abstract. This PEP adds support for syntactic macros to Python. A macro is a compile-time function that transforms a part of the program to allow functionality that cannot be expressed cleanly in normal library code. The term “syntactic” means that this sort of macro operates on the program’s syntax tree.