Sie sind auf Seite 1von 7

MACRO PROCESSOR

ACKNOWLEDGEMENT

Any achievement, be it scholastic or otherwise does not depend solely on the individual efforts
but on the guidance, encouragement and cooperation of intellectuals, elders and friends. A
number of personalities, in their own capacities have helped me in carrying out this project work.
I would like to take this opportunity to thank them all.
I deeply express my sincere gratitude to Prof. Rashmi and Prof. Vanishree K , Department of
ISE, R.V.C.E, Bengaluru,for his able guidance, regular source of encouragement and assistance
throughout this project
I would like to thank Dr. N. K. Cauvery, Head of Department, Information Science &
Engineering, R.V.C.E, Bengaluru, for his valuable suggestions and expert advice.
I would also like to thankDr. B. S. Satyanarayana, Principal, R.V.C.E, Bengaluru, for his moral
support towards completing my project work.
I thank my Parents, and all the Faculty members of Department of Information Science &
Engineering for their constant support and encouragement.
Last, but not the least, I would like to thank my peers and friends who provided me with valuable
suggestions to improve my project.

Abstract
1
Dept of ISE, RVCE

2014-15

MACRO PROCESSOR

Very often we need short-cuts to get things done fast and to avoid confusion, and that is
the exact requirement of the programming world. Today, as programming languages grow more
sophisticated and make the life of a programmer easier, the requirements keep growing.
Programming languages perform Herculean tasks as compared to their ancestors several decades
ago. For example, from the simple days of C, companies such as Microsoft have developed much
more powerful languages such as Visual C#, which has the simplicity and foundation of C. Yet,
as we progress with the use of these languages, there are still some tools that are in use today that
make processing of code much simpler.
Code grows to such an extent today that even code needs management and processing. In
this project, we look at the processing of code before it is sent for compilation. These tasks are
called pre-processor tasks, where code is prepared before it is sent for compilation. These are
also known as pre-processor directives which perform a task before the code is compiled. There
are many such tools, including macro expansions. Macros are used to make compilation easier
and more feasible. We can look at the various advantages macros give the programmer as we
look at the problems inherent with coding. It should also be noted that the subject of macros are
vast and that only a few macros will be simulated.
A macro is a piece of code or text that replaces another body of text before compilation.
In SIC/XE macros may or may not take parameters. Code is scanned and those lines starting with
MACRO are treated first and the appropriate action is performed. These lines with MACRO are
removed and that edited code is sent for compilation. Any compilation errors caused by macro
expansions have to be taken care of by the user. Macros can be used in a simple or complex way
to make effective use of code. These macros will be simulated in this project.

Table of Contents
2
Dept of ISE, RVCE

2014-15

MACRO PROCESSOR

Acknowledgement

Abstract

ii

Table of Contents

iii

List of Figures

vi

List of Tables

vii

Chapter 1
Introduction
1.1

Problem Defination

1.1.1

Code Redability

1.1.2

Function Overhead

1.1.3

Increased Processor Time

1.1.4

Compilation Issues

1.2

Basic Definitions

1.2.1
1.2.2
1.2.3
1.2.4
1.2.5

Simple Callable Macros


Macro Parameters
Macro Operators
Nested Macro Definitions
Nested and Recursive Macro Calls

2
3
4
5
5

1.3.

Block Diagram

Chapter-2
Theory and Concepts of Macro Processor
2.1

Introduction

2.2

Basic concepts of Macro processor

2.3

Types of Macro Processor

8
3

Dept of ISE, RVCE

2014-15

MACRO PROCESSOR
2.3.1

Two pass Macro processor

2.3.2

One pass Macro processor

Chapter-3
Software Requirements Specification
2.1

Hardware and Software Requirements

11

2.2

Description of Tools used

11

Chapter-4
HIGH LEVEL DESIGN
4.1

Concatenation of unique labels

12

4.2

Generation of Unique Labels

12

4.3

Conditional Macro

13

4.4

Keyword Macro Parameters

13

4.5

Language

13

4.6.1
4.6.2

Future plans
Data flow diagram

13
14

Chapter-5
DETAILED DESIGN
5.1

Data Structures for Macro processor

16

5.2

Data Flow Diagram of an overall system

17

5.3

Description of each Module

17

5.3.1

Word Scan

17

5.3.2

Process line

17

5.3.3

Define

18

5.3.4

Getline

19
4

Dept of ISE, RVCE

2014-15

MACRO PROCESSOR
5.3.5

Expand

20

Chapter-6
IMPLEMENTATION
6.1

Algorithm

22

6.2

Languge used in implementation

23

6.3

Error Detection

23

Chapter-7
SOFTWARE TESTING
7.1

Testing Process

25

7.2

Levels of Testing

25

7.3

Unit Testing

25

7.4

Integration Testing

26

7.5

System Testing and Acceptance Testing

26

7.6

Unit Testing of Main Modules

26

7.7

Summary

28

CHAPTER 8
RESULTS, DISCUSSION AND INFERENCE
8.1

Advantages and Disadvantages

29

8.2

Future Enhancements

30

REFERENCES

31

APPENDIX

32

LIST OF FIGURES
Figure 1.a

block diagram of Macro processor.

Figure 2.a

Flow Chart of 1 pass Assembler


5

Dept of ISE, RVCE

2014-15

MACRO PROCESSOR

LIST OF TABLES
Table 7.a

Check Macro Expansion

Table 7.b

Check Unique Labels


6

Dept of ISE, RVCE

2014-15

MACRO PROCESSOR
Table 7.c

Nested Expansion

Table 7.d

Time for Expansion of Macro

7
Dept of ISE, RVCE

2014-15

Das könnte Ihnen auch gefallen