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.

Dept of ISE, RVCE


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

3 Function Overhead 1 1.2. RVCE 2014-15 .3.1 1.2 1.2.4 Compilation Issues 2 1.1.5 Simple Callable Macros Macro Parameters Macro Operators Nested Macro Definitions Nested and Recursive Macro Calls 2 3 4 5 5 1.2 Basic concepts of Macro processor 7 2. Block Diagram 6 Chapter-2 Theory and Concepts of Macro Processor 2.1 Code Redability 1 1.1 Introduction 7 Problem Defination 1.MACRO PROCESSOR Acknowledgement i Abstract ii Table of Contents iii List of Figures vi List of Tables vii Chapter 1 Introduction 1.4 1.3 Types of Macro Processor 8 3 Dept of ISE.2.3 Increased Processor Time 2 1.2 Basic Definitions 1.

3 Define 18 5.2 Process line 17 Concatenation of unique labels 12 4.3.3 Description of each Module 17 5.4 Getline 19 4 Dept of ISE.1 Hardware and Software Requirements 11 2.4 Keyword Macro Parameters 13 4.3 Conditional Macro 13 4.MACRO PROCESSOR 2.2 Description of Tools used 11 Chapter-4 HIGH LEVEL DESIGN 4.2 Future plans Data flow diagram 13 14 Chapter-5 DETAILED DESIGN 5.1 Data Structures for Macro processor 16 5.5 Language 13 RVCE 2014-15 .6.1 4.2 Generation of Unique Labels 12 4.2 Data Flow Diagram of an overall system 17 5.3.2 One pass Macro processor 9 Chapter-3 Software Requirements Specification 2.1 Word Scan 17 5.1 Two pass Macro processor 8 2.

2 Future Enhancements 30 REFERENCES 31 APPENDIX 32 LIST OF FIGURES Figure 1. DISCUSSION AND INFERENCE 8.6 Unit Testing of Main Modules 26 7.MACRO PROCESSOR 5.2 Languge used in implementation 23 6.5 Expand 20 Chapter-6 IMPLEMENTATION 6.3 Error Detection 23 Chapter-7 SOFTWARE TESTING 7. RVCE 2014-15 .1 Algorithm 22 6.1 Advantages and Disadvantages 29 8.2 Levels of Testing 25 7.4 Integration Testing 26 7.a Flow Chart of 1 pass Assembler 5 Dept of ISE.1 Testing Process 25 7.5 System Testing and Acceptance Testing 26 7.7 Summary 28 CHAPTER 8 RESULTS.3.a block diagram of Macro processor. Figure 2.3 Unit Testing 25 7.

RVCE 2014-15 .MACRO PROCESSOR LIST OF TABLES Table 7.b Check Unique Labels 6 Dept of ISE.a Check Macro Expansion Table 7.

c Nested Expansion Table 7.d Time for Expansion of Macro 7 Dept of ISE.MACRO PROCESSOR Table 7. RVCE 2014-15 .