written 8.4 years ago by | • modified 8.4 years ago |
Mumbai University > Computer Engineering > Sem6 > System Programming and Compiler Construction
Marks: 10M
Year: Dec 2015
written 8.4 years ago by | • modified 8.4 years ago |
Mumbai University > Computer Engineering > Sem6 > System Programming and Compiler Construction
Marks: 10M
Year: Dec 2015
written 8.4 years ago by | • modified 8.4 years ago |
MACRO
MACRO is defined as a single line abbreviation for a group of instruction.
Syntax :
Macro
Macro name
} macro body
MEND
Features of Macro processor:
1) Recognized the macro definition.
2) Save macro definition.
3) Recognized the macro call.
4) Perform macro expansion.
Conditional Macro
The macro processor replaces each macro instruction with the corresponding group of source language statements. This is called macro expansion or expanding the macros
Conditional assembly are frequently considered to be mechanisms that allow a single version of the source code for a program to be used to generate multiple versions of the executable.
Most macro processors can also modify the sequence of statements generated for a macro expansion, depending on the arguments supplied in the macro invocation. Conditional Assembly is commonly used to describe this feature. It is also referred to as conditional macro expansion.
Conditional Assembly can be achieved with the help of AIF and AGO statements.
1) AIF Statement
Syntax :
AIF (condition) Label
If condition is satisfied the label is executed else it continue with the next execution.
2) AGO Statement
AGO. Label
Labels staring with a period (.), such as .FINI, are macro labels and do not appear in the output of the macro processor.
3) LCL Statement:
4) SET Statement:
5) ANOP Statement: