Page 99 - DCAP507_SYSTEM_SOFTWARE
P. 99
Unit 7: Macro Language
Notes
It displays an example of a SIC/XE program using macro Instructions.
This program defines and utilizes two macro instructions, RDBUFF and WRDUFF.
The functions and logic of RDBUFF macro are alike to those of the RDBUFF subroutine.
The WRBUFF macro is alike to WRREC subroutine.
Two Assembler directives (MACRO and MEND) are utilized in macro definitions.
The first MACRO statement determines the start of macro definition.
The Symbol in the label field (RDBUFF) is the name of macro, and entries in the operand
field determine the parameters of macro instruction.
In our macro language, every parameter starts with character &, which facilitates the
substitution of parameters during macro expansion.
The macro name and parameters define the outline or prototype for the macroinstruction
utilized by the programmer. The macro instruction definition has been removed since
they have been no longer needed after macros are expanded.
Every macro invocation statement has been extended into the statements that form the
body of the macro, with the arguments from macro invocation substituted for the
parameters in macro prototype.
!
Caution The arguments and parameters are connected with one another according to their
positions.
LOVELY PROFESSIONAL UNIVERSITY 93