Professional Documents
Culture Documents
Macro Pass 1
Macro Pass 1
ASSIGNMENT NO.:
Problem Statement:
Design suitable data structures and implement Pass-I of a two pass macro processor using OOP
features in Java/C++. The output of Pass-I (MNT, MDT, ALA & Intermediate code file without
any macro definitions) should be input for Pass-II.
Objectives:
Theory:
Algorithm/Flowchart:
Design diagrams (if any):
1. Class diagram
2. Sequence diagram
Input:
Small assembly language program with macros written in file input.asm.
MACRO
&lab ADDS &arg1,&arg2
&lab L 1, &arg1
A 1, &arg2
MEND
PROG START 0
BALR 15,0
USING *,15
LAB ADDS DATA1, DATA2
ST 4,1
DATA1 DC F’3’
DATA2 DC F’4’
END
Output:
Assembly language program without macro definition but with macro call.
Note: Follow the following templates during implementation
Macro Name Table (MNT):
Index Arguments
0 &lab
1 &arg1
2 &arg2
Test Cases:
Software Requirement:
1. Fedora
2. Eclipse
3. JDK
1. Define macro?
A macro is an automated input sequence that imitates keystrokes or
mouse actions. A macro is typically used to replace a repetitive series of
keyboard and mouse actions and used often in spreadsheets and word
processing applications like MS Excel and MS Word.
int mnti;
String name;
int index;
ALA:-
[&FIRST, &SECOND]
[&ARG1, &ARG2]
MDT:-
INCR1 &FIRST,&SECOND=DATA9
A 1,#0
L 2,#1
MEND
INCR2 &ARG1,&ARG2=DATA5
L 3,#0
ST 4,#1
MEND
MNT:-
1 INCR1, 1
2 INCR2, 5
Output:-
PRG2 START
USING *,BASE
INCR1 DATA1
INCR2 DATA3,DATA4
FOUR DC F'4'
FIVE DC F'5'
BASE EQU 8
TEMP DS 1F
DROP 8
END