0% found this document useful (0 votes)
5 views3 pages

SPOS Lab Assignment-04

The document outlines an assignment for implementing Pass-II of a two-pass macro-processor using Java. It details the objectives, software and hardware requirements, and the theory behind macro calls and expansions. Additionally, it includes information on data structures used in the macro processor and concludes with a set of FAQs related to the topic.

Uploaded by

snehagawande29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

SPOS Lab Assignment-04

The document outlines an assignment for implementing Pass-II of a two-pass macro-processor using Java. It details the objectives, software and hardware requirements, and the theory behind macro calls and expansions. Additionally, it includes information on data structures used in the macro processor and concludes with a set of FAQs related to the topic.

Uploaded by

snehagawande29
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab Manual –Systems Programming & Operating Systems Lab Dept.

of Computer Engineering

ASSIGNMENT NO.04
TITLE: IMPLEMENTATION OF PASS – II OF TWO PASS
MACRO-PROCESSOR

PROBLEM STATEMENT: Write a Java program for pass-II of a two-pass macro-processor.

OBJECTIVES:

• To understand macro facility, features and its use in assembly language programming.
• To study how the macro definition is processed and how macro call results in the expansion
of code.

SOFTWARE & HARDWARE REQUIREMENTS:


1. 64-bit Open source Linux or its derivative
2. Eclipse
3. JDK

THEORY:
Macro Pass – II (Macro Calls & Expansion)
The algorithm for Pass- II tests mnemonic of each line to see if it is a name in the MNT.
When a call is found, the call processor sets a pointer, the Macro Definition Table Pointer
(MDTP), to the corresponding macro definition stored in MDT.
The initial value of MDT is obtained from the “MDT index” field of the MNT entry.
The macro expander prepares the Argument List Array (ALA) consisting of a table of dummy
argument indices and corresponding arguments to the call.
As each successive line is read, the values from the argument list are substituted for dummy
argument indices in the macro definition. Reading of the MEND line in the MDT terminates
expansion of the macro, and scanning continues from the input file. When the END is
encountered, the expanded source program is transferred to the assembler for further
processing.

Macro Processor Pass – II Data Structures

1. The input file (Output of Pass - I)


2. The output file (To store Target Program)
3. The Macro Definition Table (MDT), created by Pass – I
4. The Macro Name Table (MNT), created by Pass – I
5. The Macro Definition Table Pointer (MDTP), used to indicate the next line of text to be used
during macro expansion

International Institute of Information Technology, Hinjawadi, Pune. Page 1


Lab Manual –Systems Programming & Operating Systems Lab Dept. of Computer Engineering

6. The Argument List Array (ALA), used to substitute macro call arguments for the index
markers in the stored macro definition

PASS II Output

CONCLUSION:

International Institute of Information Technology, Hinjawadi, Pune. Page 2


Lab Manual –Systems Programming & Operating Systems Lab Dept. of Computer Engineering

FAQs

1. What is meant by macro time variable?

2. What are the three main data structures used by our macro processor?

3. How many parameters can a macro have?

4. What is the difference between attributes of symbols and of macro arguments?

5. What should be printed in the object code field when a macro definition is listed?

International Institute of Information Technology, Hinjawadi, Pune. Page 3

You might also like