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
- Difference between Direct and Immediate Addressing Modes
- Difference between Indirect and Immediate Addressing Modes
- Internal Registers of DMA Controller
- Difference between SIM and RIM instructions in 8085 microprocessor
- How Computer / Laptop Starts ?
- Levels of Memory in Operating System
- Difference between Hardwired and Microprogrammed Control Unit
- Special Purpose Computer Systems
- Three-State Bus Buffers
- Interfacing 8155 I/O ports and 8279 with multiple Addresses
- Control Signals in 8155 Microprocessor
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.