“introduction of sp” - … · general design procedure of two pass assembler 1. specify the...
TRANSCRIPT
![Page 1: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/1.jpg)
Pune Vidyarthi Griha’s
COLLEGE OF ENGINEERING, NASHIK – 4.
“INTRODUCTION OF SP”
By
Prof. Anand N. Gharu (Assistant Professor)
PVGCOE Computer Dept.
28th Dec 2017 .
![Page 2: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/2.jpg)
CONTENTS :-
1. Introduction
2. Components of Software System
- Text editor
- Loader
- Assembler
- Macroprocessor
- Compiler
- Debugger
- Machine Structure
- Machine Language
- Assembly Language
3. Assemblers : General design procedure
Design of assembler
![Page 3: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/3.jpg)
Introduction SOFTWARE DEVELOPMENT TOOLS :-
![Page 4: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/4.jpg)
EDITOR
![Page 5: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/5.jpg)
• .
BASIC FUNCTION OF LOADER
![Page 6: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/6.jpg)
GENERAL LOADING SCHEME
![Page 7: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/7.jpg)
RELOCATION
![Page 8: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/8.jpg)
ASSEMBLY LANGUAGE PROGRAMMING
![Page 9: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/9.jpg)
MACROPROCESSOR
![Page 10: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/10.jpg)
![Page 11: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/11.jpg)
COMPILER
![Page 12: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/12.jpg)
MACHINE LANGUAGE & ASSEMBLY LANGUAGE
![Page 13: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/13.jpg)
MACHINE OPCODE TABLE (MOT)
![Page 14: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/14.jpg)
SAMPLE PROGRAM FOR FINDING X + Y
![Page 15: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/15.jpg)
![Page 16: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/16.jpg)
![Page 17: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/17.jpg)
![Page 18: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/18.jpg)
ASSEMBLY LANGUAGE STATEMENT
![Page 19: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/19.jpg)
ONE PASS ASSEMBLER
![Page 20: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/20.jpg)
ONE PASS ASSEMBLER WITH FORWARD REFERENCES
![Page 21: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/21.jpg)
![Page 22: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/22.jpg)
DESIGN OF SINGLE PASS ASSEMBLER
![Page 23: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/23.jpg)
![Page 24: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/24.jpg)
ADVANCED ASSEMBLER DIRECTIVES
![Page 25: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/25.jpg)
![Page 26: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/26.jpg)
DESIGN OF TWO PASS ASSEMBLER
![Page 27: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/27.jpg)
![Page 28: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/28.jpg)
ASSEMBLY LANGUAGE PROGRAM FOR UNDERSTANDING PASS - 1
![Page 29: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/29.jpg)
![Page 30: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/30.jpg)
![Page 31: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/31.jpg)
INTERMEDIATE CODE
![Page 32: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/32.jpg)
![Page 33: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/33.jpg)
![Page 34: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/34.jpg)
![Page 35: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/35.jpg)
PASS-2 OF TWO PASS ASSEMBLER
![Page 36: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/36.jpg)
![Page 37: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/37.jpg)
![Page 38: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/38.jpg)
![Page 39: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/39.jpg)
![Page 40: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/40.jpg)
![Page 41: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/41.jpg)
![Page 42: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/42.jpg)
Components of System Programming
• Interpreter
• Assembler
• Compiler
• Macros and Microprocessors
• Formal systems
• Debugger
• Linkers
• Operating system
![Page 43: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/43.jpg)
Need Of System Software
The basic need of system software is to achieve the
following goals :-
• To achieve efficient performance of the system
• To make effective execution of general user
program
• To make effective utilization of human resources
• To make available new, better facilities
![Page 44: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/44.jpg)
Operating System
• It is the collection of system programs which acts as an interface between user and the computer and computer hardware.
• The purpose of an operating system is to provide an environment in which A user can execute programs in a convenient manner
![Page 45: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/45.jpg)
Functions of Operating System
• File handling and management.
• Storage management (Memory management).
• Device scheduling and management.
• CPU scheduling.
• Information management.
• Process control (management).
• Error handling
• Protecting itself from user & protecting user from other users.
![Page 46: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/46.jpg)
Translators • These are the system programs that converts
the source program into computer understandable fashion
• Types of translators
– Single Pass translator
– Multi Pass translator
![Page 47: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/47.jpg)
Translators • Assembler:-
• These are the system programs which will automatically translate the assembly language program in to the machine language program
Source program Assembly Lang. Prog.
Target program / M/C Lang. Prog.
Assembler
Database
![Page 48: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/48.jpg)
Translators • Complier:-
• These are the system programs which will automatically translate the High level language program in to the machine language program
Source program High level Lang. Prog.
Target program / M/C Lang. Prog.
Compiler
Database
![Page 49: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/49.jpg)
Translators • Cross Assembler:- • These are the system programs which will automatically
translate the Assembly Language program compatible with M/C A, in to the machine language program compatible with M/C A
Cross Assembler
Source program Assembly Lang. Prog. Compatible with M/C A
Target program / M/C Lang. Prog. Compatible with M/C A
M/C B
![Page 50: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/50.jpg)
Translators • Cross Compiler:- • These are the system programs which will automatically
translate the HLL program compatible with M/C A, in to the machine language program compatible with M/C A , but the underlying M/C is M/C B
Cross Compiler
Source program
HLL Prog. Compatible with M/C A
Target program / M/C Lang. Prog.
M/C B
![Page 51: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/51.jpg)
Translators • Interpreter
– It is the language translator which execute source
program line by line with out translating them into machine language.
![Page 52: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/52.jpg)
Loader
• A Loader is system program that place the object program into main memory and prepares it for execution.
• Basic functions of loader
– Allocation
– Linking
– Relocation
– Loading
![Page 53: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/53.jpg)
Types of Loader
• Compile-and-go Loader
• Relocating Loader
• Direct Linking Loader
• Absolute Loader
• General Loader
• Dynamic Loader
![Page 54: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/54.jpg)
Macro & Macro processor
• Macro – Macro is a single line abbreviation for a group of instruction.
--------Start of definition
-------- Macro name
MACRO INCR
A 1,DATA
A 2,DATA Sequence of instructions to be abbreviated.
A 3,DATA
MEND -------- End of definition
![Page 55: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/55.jpg)
Linking and Linker
• Linking
– The Process of merging many object modules to
form a single object program is called as linking.
• Linker
• The Linker is the software program which binds many object modules to make a single object program.
![Page 56: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/56.jpg)
Formal System
• A formal system is an un interpreted calculus.
It consists of
– Alphabets
– A set of words called Axioms.
– Finite set of relations called rules of inference or
production rules.
– Ex Boolean algebra.
![Page 57: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/57.jpg)
Types of Assembly Language statements
• Imperative statements
–An imperative statement in assembly language indicates the action to be performed during execution of assembly statement
![Page 58: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/58.jpg)
• Declarative Statement:-
– These statements declares the storage area or
declares the constant in program.
– EX A DS 1
ONE DC “1”
![Page 59: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/59.jpg)
• Assembler Directives
– These are the statements used to indicate certain thing regarding how assembly of input program is to be performed.
– Ex START 100
USING *, 15
![Page 60: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/60.jpg)
Types of Assembler
• Single pass Assembler
• Multi pass Assembler
![Page 61: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/61.jpg)
Problem of Forward Reference
• When the variables are used before their definition at that time problem of forward reference accurse.
![Page 62: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/62.jpg)
Problem of Forward Reference
JOHN START 0
USING *, 15
L 1, FIVE
A 1,FOUR
ST 1, TEMP
FIVE DC TEMP DS
FOUR DC F’4’ F’5’ 1F END
![Page 63: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/63.jpg)
General Design Procedure of Two Pass Assembler
1. Specify the problem
2. Specify data structures
3. Define format of data structures
4. Specify algorithm
5. Look for modularity [capability of one program to be subdivided into independent programming units.]
6. Repeat 1 through 5 on modules.
![Page 64: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/64.jpg)
Step 2. Data structure:-
Pass1: Databases
• Input source program • “LC” location counter used to keep track of each
instructions addr. • M/c operation table (MOT) [Symbolic mnemonic & length]
• Pseudo operation table [POT], [Symbolic mnemonic &
action]
• Symbol Table (ST) to store each lable & it’s value. • Literal Table (LT), to store each literal (variable) &
it’s location. • Copy of input to used later by PASS-2.
![Page 65: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/65.jpg)
Step 2. Data structure:-
• Pass2: Databases
• Copy of source program input to Pass1.
• Location Counter (LC)
• MOT [Mnemonic, length, binary m/c op code, etc.]
• POT [Mnemonic & action to be taken in Pass2
• ST [prepared by Pass1, label & value]
• Base Table [or register table] indicates which registers are currently specified using ‘USING’ pseudo op & what are contents.
• Literal table prepared by Pass1. [Lit name & value].
![Page 66: “INTRODUCTION OF SP” - … · General Design Procedure of Two Pass Assembler 1. Specify the problem 2. Specify data structures 3. Define format of data structures 4. Specify algorithm](https://reader030.vdocument.in/reader030/viewer/2022021517/5b778eb47f8b9a8f698d2c76/html5/thumbnails/66.jpg)
Thank You
1/4/2018 66