A Macro instruction is the notational convenience for the programmer. For every occurrence of macro the whole macro body or macro block of statements gets expanded in the main source code. Thus Macro instructions makes writing code more convenient.
Silent features of Macro Processor:
- Macro represents a group of commonly used statements in the source programming language.
- Macro Processor replace each macro instruction with the corresponding group of source language statements. This is known as expansion of macros.
- Using Macro instructions programmer can leave the mechanical details to be handled by the macro processor.
- Macro Processor designs are not directly related to the computer architecture on which it runs.
- Macro Processor involves definition, invocation and expansion.
Macro Definition and Expansion:
Line Label Opcode Operand 5 COPY START 0 10 RDBUFF MACRO &INDEV, &BUFADR 15 . . 90 95 MEND
- Line 10:
RDBUFF (Read Buffer) in the Label part is the name of the Macro or definition of the Macro. &INDEV and &BUFADR are the parameters present in the Operand part. Each parameter begins with the character &.
- Line 15 – Line 90:
From Line 15 to Line 90 Macro Body is present. Macro directives are the statements that make up the body of the macro definition.
- Line 95:
MEND is the assembler directive that means the end of the macro definition.
Line Label Opcode Operand 180 FIRST STL RETADR 190 CLOOP RDBUFF F1, BUFFER 15 . . 255 END FIRST
RDBUFF is the Macro invocation or Macro Call that gives the name of the macro instruction being invoked and F1, BUFFER are the arguments to be used in expanding the macro. The statement that form the expansion of a macro are generated each time the macro is invoked.
- Introduction of Input-Output Processor
- Difference between RISC and CISC processor | Set 2
- Vector processor classification
- Capacitive Touch Technology
- Difference between Serial Port and Parallel Ports
- Difference between Direct and Indirect Addressing Modes
- Difference between Impact and Non-Impact Printers
- Difference between Asymmetric and Symmetric Multiprocessing
- Difference between Magnetic Disk and Optical Disk
- Difference between Hardware and Software
- Difference between Cold Booting and Warm Booting
- Different Classes of CPU Registers
- Bit manipulation | Swap Endianness of a number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.