27-04-2011, 10:07 AM
two pass Macro-Processor.ppt (Size: 1.85 MB / Downloads: 83)
Macro-Processor
Design Of Two-Pass Macro-Processor
Pass-I (Macro-def) data structures
The I/P macro source program.
Macro-defination table
Macro name table
MDTC
MNTC
ALA
Copy of SP use by Pass-II
Pass-II (Macro-calls & Expansions) data tructures
The I/P macro source program.
Macro-definition table ,created by Pass-I
Macro name table, created by Pass-I
MDTP
ALA
Copy of expanded sp to be used by assembler
MACRO
&lab INCR &arg1, &arg2, &arg3
A 1, &arg1
A 2, &arg2
A 3, &arg3
MEND
L1 INCR DATA1,DATA2,DATA3
Macro-Definition table (MDT)
Macro Name Table
Argument List Array
Macro – Definition in Macro Implementation
Def of one macro contains another defination
Only a call to an outer macro can define inner macro
Two additional variables are maintained
MDI : it has value “ON” during expansion of a macro & “OFF” at all other times.
MDLC : it is incremented by 1 when a MACRO pseudo-op & decremented by 1 when MEND