Great to know that you are curious about the databases used in the MACRO Pass1 and Pass2.
Here we Go.!!!!!
Pass 1: Databases
- Source Program
- Output of Source Program to be fed to Pass 2
- Macro Definition Table (MDT)- Stores Macro Definitions
- Macro Name Table(MNT) - Stores the Macro Name that are defined in the Program
- Macro Definition Table Counter (MDTC) - Indicates next available entry in MDT
- Macro Name Table Counter (MNTC) - Indicates next available entry in MNT
- Argument List Array (ALA)- Stores the index markers for dummy arguments
Pass 2: Databases
Example
MACRO
&PAC ADDM &ARG1,&ARG2,&ARG3
A 1, &ARG1
A 2, &ARG2
- Input Source Program
- Expanded Source Code i.e Output for Assembler
- Macro Definition Table (MDT)- Created and Maintained by Pass 1
- Macro Name Table(MNT) - Created and Maintained by Pass 1
- Macro Definition Table Pointer (MDTP) - Indicate next line used in Expansion.
- Arguments List Arrays (ALA)- Substitutes arguments for index markers.
Example
MACRO
&PAC ADDM &ARG1,&ARG2,&ARG3
A 1, &ARG1
A 2, &ARG2
A 3, &ARG3
MEND
..................................................
LOOP ADDM D1,D2,D3
..................................................
MEND
..................................................
LOOP ADDM D1,D2,D3
..................................................
| INDEX | ARGUMENT |
|---|---|
| 0 | LOOPbbbb |
| 1 | D1bbbbbb |
| 2 | D2bbbbbb |
| 3 | D3bbbbbb |
| INDEX | CARD |
|---|---|
| 10 | &PAC ADDM &ARG1,&ARG2,&ARG3 |
| 11 | A 1,#1 |
| 12 | A 2,#2 |
| 13 | A 3,#3 |
| 14 | MEND |
| INDEX | NAME | MDT INDEX |
|---|---|---|
| 8-BYTES | 4 BYTES | |
| . . . | . . . | . . . |
| 3 | ADDMbbbb | 10 |
| . . . | . . . | . . . |
Comments
Post a Comment