SlideShare a Scribd company logo
Dr. Mahesh R. Sanghavi
Unit- I
Introduction
SPOS
By
Dr. Mahesh R. Sanghavi
Unit- I
Course Outcome
SPOS
To analyze & synthesize various
system software & understand the
design of two pass assemblers.
Dr. Mahesh R. Sanghavi
Unit- I
Outline
SPOS
Introduction
Software
Assemblers
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
instruct
Component
System
is
Collection
of
eg.
College
Programming
is
Way to
compute
the
Various Task
To perform
system programming is an art of designing and implementing system Programs.
System introduction
Dr. Mahesh R. Sanghavi
Unit- I
System introduction
SPOS
Software
Collection
is
of
Many
Programs
Software
System
Software
Application
Software
assist general
user application
Operating System
Assembler
software developed
for the specific goal
Media player
Adobe Reader
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
System Program
Required
Effective Execution
General user Programs
Computer System
are
for
of
on
System Programming
designing and implementing
system programs
Is an art of
System introduction
Dr. Mahesh R. Sanghavi
Unit- I
System Software
SPOS
Text Editor
Editor
Computer
Program
A user
create and revise a
document
Text Editor
Program
Primary
Elements
Edited
Character
String
is
In which
being are
is
That allows
to
Notepad
Example
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Text Editor
program
Used for
is
Editing plain
text files
With the help
Text Editor
of
Write Your Program
You can
C | Java
Prog.
Example
System Software
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
System Software
Loders
Program
Object Code
As input
is
That takes
Prepares
and
Execution
Them for
Initiates
it
Execution
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Loders
System Software
Relocation
Linking
Allocation
Loading
Functions
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Loders
System Software
Allocation
Functions
Loader allocates space for programs in main
memory.
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Loders
System Software
Relocation
Functions
● Adjusting all address dependent location.
● E.g. If we have two Programs Program A and Program B.
● Program A is saved at location 100.
● And user wants to save Program B on same location.
That is physically not possible.
● So loader relocates program B to some another free
location
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Loders
System Software
Linking
Functions
● If we have different modules of our
program.
● Loader links object modules with each
other.
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Loders
System Software
Loading
Functions
Physically loading the machine instructions and
data into main memory.
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Outline
❏ Review of previous session
❏ Assembler
❏ Macro Processor
❏ Compiler
❏ Debugger
❏ Assembly Language
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Loders
System Software
Relocation
Linking
Allocation
Loading
Functions
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembler
Machine Lang.
Assembly Lang.
Program Assembler
Translate
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Macro Processor
Macro
Sequence
Source Lang. Code
Referred many times
Allows
of
Defined @ once
To be
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Macro
Macro Processor
Syntax
Macro name [ set of parameters ]
// macro body
Mend
★ A macro processor takes a source with
macro definition and macro calls and
replaces each macro call with its body
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Compiler
Low Level Lang.
High Level Lang.
Compiler
Converts
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Compiler
Benefits of writing a program in a high level language
Increases productivity Machine Independence
It is very easy to write a program in a
high level language
A program written in a high level language is
machine independent.
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Debugger
Debugging tool helps programmer for testing and debugging
programs
It provides some facilities:
•Setting breakpoints.
•Displaying values of variables.
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
● Assembly language is middle level language.
● An assembly language is machine dependent.
● It differs from computer to computer.
● Writing programs in assembly language is very easy as compared to
machine(binary) language
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Assembly language programming Terms
Location Counter points to the next instruction
(LC)
Literals Constant Values
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Assembly language programming Terms
Symbols Name of variables and labels
Procedures Methods | Function
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Assembly language Statements:
Imperative
Statements
Declarative/Declaration
Statements
Assembler Directive
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Imperative
Statements
❏ Imperative means mnemonics
❏ These are executable statements.
❏ Each imperative statement indicates an
action to be taken during execution of the
program
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Declarative/Declaration
Statements
❏ Declaration statements are for
reserving memory for variables.
❏ We can specify the initial value of
a variable.
Types
DS DC
Declare Storage Declare Constant
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Declare Storage
Syntax
[ Label ] DS < Constraint Specifying size >
X DS 1
Example
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Declare Constant
Syntax
[ Label ] DC < Constraint Specifying values >
X DC ‘ 5 ’
Example
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Assembler Directive
❏ Assembler directive instruct the
assembler to perform certain actions
during assembly of a program
Some assembler directive are:
START < Address Constant >
END
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Advance Assembler Directive
Origin
EQU
USING
DROP
LTORG
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Outline
❏ Review of previous session ❏ Identify Statement
❏ Pass 1 Assembler
❏ Machine Structure
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Sample Assembly language Code
1. START 100
2. MOVER A REG, X
3. MOVER B REG, Y
4. ADD A REG, Y
5. MOVEM A REG, X
6. X DC ‘10’
7. Y DS 1
8. END
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Identify types of statement 1. START 100
IS DS AD
Sr. No
1.
2.
3.
4.
2. MOVER B REG, Y
3. MOVER B REG, Y
4. ADD A REG, Y
Code
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Identify types of statement 5. MOVEM A REG, X
IS DS AD
Sr. No
5.
6.
7.
8.
6. X DC ‘10’
7. Y DS 1
8. End
Code
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembly Language
Some Definitions
LC
Symbol Literals
Procedures
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Machine Structure
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Machine Structure
Machine Instruction Format
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembler
Assembler
Pass 1
Assembler Pass 2
Assembler
Separate Generate the
machine code
Determine Storage
Requirement
Build the Symbol
Table
Labels
Operand Fields
Mnemonic Opcode
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Pass 1 Assembler
Uses
How pass 1 assembler works?
Machine opcode Table
Symbol Table Pool Table
Literal Table
Data Structure
Pass 1
Assembler
❏ Contents of MOT are fixed for an assembler.
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Apply LC
Observe code
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Symbol Table
Construct
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Construct
Literal Table
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Pool table contains starting
literal(index ) of each pool.
Pool Table
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
|
Construct
Machine Code Intermediate Code
Machine opcode Table
needs
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Enhanced Machine Opcode Table
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Enhanced Machine Opcode Table
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Intermediate code
❏ For every line of assembly statement, one
line of intermediate code is generated
❏ Each mnemonic field is represented as
(Statement Class , Machine code)
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Intermediate code
Statement Class
Can be
IS DS | DC AD
MOVER AREG, X
Mnemonic Field Operand Field
IC for mnemonic field of above line is ,
(Statement Class , Machine code)
( IS,04 )
From MOT
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Intermediate code
Operand Field
S
Symbol
L
Literal
RG
Register
CC
Condition Codes
C
Constant
Operand Field
( operand Class , reference )
represented
For a symbol or literal the reference field
contains the index of the operands entry in
symbol table or literal table.
START 200 (AD, 01) (C, 200)
E.g.
MOVER AREG, X
(IS, 04) (RG, 01) (S, 0)
Mnemonic
code
Pass 1 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Intermediate code
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Example 2
Assignment
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Outline
❏ Review of previous session
❏ Pass 2 Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Pass 2 Assembler
Pass 2 Assembler
Intermediate code Machine Code
Pass 2 Assembler
❏ Processes the intermediate representation (IR) to
synthesize the target program.
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Pass 2 Assembler
Pass 2 Assembler
Data Structure
Pass I Pass II
Intermediate code
Source
Program
Target
Program
Data Access
Control transfer
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Pass 2 Assembler
Analysis Phase Synthesis Phase
Vs
Unit- I
SPOS
Assembler
Dr. Mahesh R. Sanghavi
Unit- I
SPOS
Assembler
Dr. Mahesh R. Sanghavi
Pass 1 Pass 2
Intermediate Code Machine Code
Output of Pass 1 | Pass 2 Assembler
Generates Generates
Unit- I
SPOS
Assembler
Dr. Mahesh R. Sanghavi
Variants
Variants I Variants II
Variants of Intermediate Code
Unit- I
SPOS
Assembler
Dr. Mahesh R. Sanghavi
Variants I
Variants of Intermediate Code
In Variant I, each operand is represented by a pair of the form
(operand class, code).
The operand class is one of:
1. S for symbol
2. L for literal
3. C for constant
4. RG for register.
Unit- I
SPOS
Assembler
Dr. Mahesh R. Sanghavi
Variants I
Variants of Intermediate Code
Unit- I
SPOS
Assembler
Dr. Mahesh R. Sanghavi
Variants II
Variants of Intermediate Code
In variant II, operands are processed selectively.
Constants and literals are processed. Symbols, condition
codes and CPU registers are not processed.
Unit- I
SPOS
Assembler
Dr. Mahesh R. Sanghavi
Variants II
Variants of Intermediate Code
System Programming :: Assembler

More Related Content

What's hot

Preprocessor directives in c language
Preprocessor directives in c languagePreprocessor directives in c language
Preprocessor directives in c language
tanmaymodi4
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
Akhil Kaushik
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
Akhil Kaushik
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
Deepmala Sharma
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
Farooq Mian
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
Vasim Pathan
 
Parse Tree
Parse TreeParse Tree
Parse Tree
A. S. M. Shafi
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler Design
Muhammed Afsal Villan
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
Temesgen Molla
 
Theory of computation Lec3 dfa
Theory of computation Lec3 dfaTheory of computation Lec3 dfa
Theory of computation Lec3 dfa
Arab Open University and Cairo University
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
Saranya1702
 
Decision making statements in C programming
Decision making statements in C programmingDecision making statements in C programming
Decision making statements in C programming
Rabin BK
 
Macro Processor
Macro ProcessorMacro Processor
Macro Processor
Saranya1702
 
The role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler designThe role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler design
Sadia Akter
 
Assemblers
AssemblersAssemblers
Assemblers
Dattatray Gandhmal
 
Linkers And Loaders
Linkers And LoadersLinkers And Loaders
Linkers And Loaders
Satpal Parmar
 
Parsing
ParsingParsing
Parsing
khush_boo31
 
Unit 3
Unit 3Unit 3
Unit 3
pm_ghate
 

What's hot (20)

Preprocessor directives in c language
Preprocessor directives in c languagePreprocessor directives in c language
Preprocessor directives in c language
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
 
Lexical Analysis - Compiler Design
Lexical Analysis - Compiler DesignLexical Analysis - Compiler Design
Lexical Analysis - Compiler Design
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
 
Theory of Automata
Theory of AutomataTheory of Automata
Theory of Automata
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
 
Parse Tree
Parse TreeParse Tree
Parse Tree
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler Design
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Theory of computation Lec3 dfa
Theory of computation Lec3 dfaTheory of computation Lec3 dfa
Theory of computation Lec3 dfa
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
 
Decision making statements in C programming
Decision making statements in C programmingDecision making statements in C programming
Decision making statements in C programming
 
Macro Processor
Macro ProcessorMacro Processor
Macro Processor
 
Assembler
AssemblerAssembler
Assembler
 
The role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler designThe role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler design
 
Assemblers
AssemblersAssemblers
Assemblers
 
Linkers And Loaders
Linkers And LoadersLinkers And Loaders
Linkers And Loaders
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Parsing
ParsingParsing
Parsing
 
Unit 3
Unit 3Unit 3
Unit 3
 

Similar to System Programming :: Assembler

Software development slides
Software development slidesSoftware development slides
Software development slidesiarthur
 
SPOS UNIT1 PPTS (1).pptx
SPOS UNIT1 PPTS (1).pptxSPOS UNIT1 PPTS (1).pptx
SPOS UNIT1 PPTS (1).pptx
RavishankarBhaganaga
 
Software development slides
Software development slidesSoftware development slides
Software development slidesiarthur
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processor
shindept123
 
01. Introduction.ppt
01. Introduction.ppt01. Introduction.ppt
01. Introduction.ppt
ReshmaR57
 
Assembly level language
Assembly level languageAssembly level language
Assembly level language
PDFSHARE
 
Chapter#01 cc
Chapter#01 ccChapter#01 cc
Chapter#01 cc
abdulbaki3
 
Basic of Programming (Introduction to Programming)
Basic of Programming (Introduction to Programming)Basic of Programming (Introduction to Programming)
Basic of Programming (Introduction to Programming)
JohnNama
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
DrIsikoIsaac
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
rrbornarecm
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
Ali Raza
 
Chap 1-dhamdhere system programming
Chap 1-dhamdhere system programmingChap 1-dhamdhere system programming
Chap 1-dhamdhere system programming
TanzoGamerz
 
lec00-Introduction.pdf
lec00-Introduction.pdflec00-Introduction.pdf
lec00-Introduction.pdf
wigewej294
 
Code generation errors and recovery
Code generation errors and recoveryCode generation errors and recovery
Code generation errors and recovery
Momina Idrees
 
Cs6660 compiler design
Cs6660 compiler designCs6660 compiler design
Cs6660 compiler design
hari2010
 
UNIT 2 ECSE-2.pptx
UNIT 2 ECSE-2.pptxUNIT 2 ECSE-2.pptx
UNIT 2 ECSE-2.pptx
AdharshKokkula
 
Lesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptxLesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptx
Neil Mutia
 
compiler construction tool in computer science .
compiler construction tool in computer science .compiler construction tool in computer science .
compiler construction tool in computer science .
RanitHalder
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
Keerty Smile
 

Similar to System Programming :: Assembler (20)

Software development slides
Software development slidesSoftware development slides
Software development slides
 
Assembly
AssemblyAssembly
Assembly
 
SPOS UNIT1 PPTS (1).pptx
SPOS UNIT1 PPTS (1).pptxSPOS UNIT1 PPTS (1).pptx
SPOS UNIT1 PPTS (1).pptx
 
Software development slides
Software development slidesSoftware development slides
Software development slides
 
Chap 1-language processor
Chap 1-language processorChap 1-language processor
Chap 1-language processor
 
01. Introduction.ppt
01. Introduction.ppt01. Introduction.ppt
01. Introduction.ppt
 
Assembly level language
Assembly level languageAssembly level language
Assembly level language
 
Chapter#01 cc
Chapter#01 ccChapter#01 cc
Chapter#01 cc
 
Basic of Programming (Introduction to Programming)
Basic of Programming (Introduction to Programming)Basic of Programming (Introduction to Programming)
Basic of Programming (Introduction to Programming)
 
Chapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdfChapter1pdf__2021_11_23_10_53_20.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
 
Software programming and development
Software programming and developmentSoftware programming and development
Software programming and development
 
Chap 1-dhamdhere system programming
Chap 1-dhamdhere system programmingChap 1-dhamdhere system programming
Chap 1-dhamdhere system programming
 
lec00-Introduction.pdf
lec00-Introduction.pdflec00-Introduction.pdf
lec00-Introduction.pdf
 
Code generation errors and recovery
Code generation errors and recoveryCode generation errors and recovery
Code generation errors and recovery
 
Cs6660 compiler design
Cs6660 compiler designCs6660 compiler design
Cs6660 compiler design
 
UNIT 2 ECSE-2.pptx
UNIT 2 ECSE-2.pptxUNIT 2 ECSE-2.pptx
UNIT 2 ECSE-2.pptx
 
Lesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptxLesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptx
 
compiler construction tool in computer science .
compiler construction tool in computer science .compiler construction tool in computer science .
compiler construction tool in computer science .
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 

Recently uploaded

The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 

Recently uploaded (20)

The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 

System Programming :: Assembler

  • 1. Dr. Mahesh R. Sanghavi Unit- I Introduction SPOS By
  • 2.
  • 3. Dr. Mahesh R. Sanghavi Unit- I Course Outcome SPOS To analyze & synthesize various system software & understand the design of two pass assemblers.
  • 4. Dr. Mahesh R. Sanghavi Unit- I Outline SPOS Introduction Software Assemblers
  • 5. Dr. Mahesh R. Sanghavi Unit- I SPOS instruct Component System is Collection of eg. College Programming is Way to compute the Various Task To perform system programming is an art of designing and implementing system Programs. System introduction
  • 6. Dr. Mahesh R. Sanghavi Unit- I System introduction SPOS Software Collection is of Many Programs Software System Software Application Software assist general user application Operating System Assembler software developed for the specific goal Media player Adobe Reader
  • 7. Dr. Mahesh R. Sanghavi Unit- I SPOS System Program Required Effective Execution General user Programs Computer System are for of on System Programming designing and implementing system programs Is an art of System introduction
  • 8. Dr. Mahesh R. Sanghavi Unit- I System Software SPOS Text Editor Editor Computer Program A user create and revise a document Text Editor Program Primary Elements Edited Character String is In which being are is That allows to Notepad Example
  • 9. Dr. Mahesh R. Sanghavi Unit- I SPOS Text Editor program Used for is Editing plain text files With the help Text Editor of Write Your Program You can C | Java Prog. Example System Software
  • 10. Dr. Mahesh R. Sanghavi Unit- I SPOS System Software Loders Program Object Code As input is That takes Prepares and Execution Them for Initiates it Execution
  • 11. Dr. Mahesh R. Sanghavi Unit- I SPOS Loders System Software Relocation Linking Allocation Loading Functions
  • 12. Dr. Mahesh R. Sanghavi Unit- I SPOS Loders System Software Allocation Functions Loader allocates space for programs in main memory.
  • 13. Dr. Mahesh R. Sanghavi Unit- I SPOS Loders System Software Relocation Functions ● Adjusting all address dependent location. ● E.g. If we have two Programs Program A and Program B. ● Program A is saved at location 100. ● And user wants to save Program B on same location. That is physically not possible. ● So loader relocates program B to some another free location
  • 14. Dr. Mahesh R. Sanghavi Unit- I SPOS Loders System Software Linking Functions ● If we have different modules of our program. ● Loader links object modules with each other.
  • 15. Dr. Mahesh R. Sanghavi Unit- I SPOS Loders System Software Loading Functions Physically loading the machine instructions and data into main memory.
  • 16.
  • 17. Dr. Mahesh R. Sanghavi Unit- I SPOS Outline ❏ Review of previous session ❏ Assembler ❏ Macro Processor ❏ Compiler ❏ Debugger ❏ Assembly Language
  • 18. Dr. Mahesh R. Sanghavi Unit- I SPOS Loders System Software Relocation Linking Allocation Loading Functions
  • 19. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembler Machine Lang. Assembly Lang. Program Assembler Translate
  • 20. Dr. Mahesh R. Sanghavi Unit- I SPOS Macro Processor Macro Sequence Source Lang. Code Referred many times Allows of Defined @ once To be
  • 21. Dr. Mahesh R. Sanghavi Unit- I SPOS Macro Macro Processor Syntax Macro name [ set of parameters ] // macro body Mend ★ A macro processor takes a source with macro definition and macro calls and replaces each macro call with its body
  • 22. Dr. Mahesh R. Sanghavi Unit- I SPOS Compiler Low Level Lang. High Level Lang. Compiler Converts
  • 23. Dr. Mahesh R. Sanghavi Unit- I SPOS Compiler Benefits of writing a program in a high level language Increases productivity Machine Independence It is very easy to write a program in a high level language A program written in a high level language is machine independent.
  • 24. Dr. Mahesh R. Sanghavi Unit- I SPOS Debugger Debugging tool helps programmer for testing and debugging programs It provides some facilities: •Setting breakpoints. •Displaying values of variables.
  • 25. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language ● Assembly language is middle level language. ● An assembly language is machine dependent. ● It differs from computer to computer. ● Writing programs in assembly language is very easy as compared to machine(binary) language
  • 26.
  • 27. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Assembly language programming Terms Location Counter points to the next instruction (LC) Literals Constant Values
  • 28. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Assembly language programming Terms Symbols Name of variables and labels Procedures Methods | Function
  • 29. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Assembly language Statements: Imperative Statements Declarative/Declaration Statements Assembler Directive
  • 30. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Imperative Statements ❏ Imperative means mnemonics ❏ These are executable statements. ❏ Each imperative statement indicates an action to be taken during execution of the program
  • 31. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Declarative/Declaration Statements ❏ Declaration statements are for reserving memory for variables. ❏ We can specify the initial value of a variable. Types DS DC Declare Storage Declare Constant
  • 32. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Declare Storage Syntax [ Label ] DS < Constraint Specifying size > X DS 1 Example
  • 33. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Declare Constant Syntax [ Label ] DC < Constraint Specifying values > X DC ‘ 5 ’ Example
  • 34. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Assembler Directive ❏ Assembler directive instruct the assembler to perform certain actions during assembly of a program Some assembler directive are: START < Address Constant > END
  • 35. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Advance Assembler Directive Origin EQU USING DROP LTORG
  • 36.
  • 37. Dr. Mahesh R. Sanghavi Unit- I SPOS Outline ❏ Review of previous session ❏ Identify Statement ❏ Pass 1 Assembler ❏ Machine Structure
  • 38. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Sample Assembly language Code 1. START 100 2. MOVER A REG, X 3. MOVER B REG, Y 4. ADD A REG, Y 5. MOVEM A REG, X 6. X DC ‘10’ 7. Y DS 1 8. END
  • 39. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Identify types of statement 1. START 100 IS DS AD Sr. No 1. 2. 3. 4. 2. MOVER B REG, Y 3. MOVER B REG, Y 4. ADD A REG, Y Code
  • 40. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Identify types of statement 5. MOVEM A REG, X IS DS AD Sr. No 5. 6. 7. 8. 6. X DC ‘10’ 7. Y DS 1 8. End Code
  • 41. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembly Language Some Definitions LC Symbol Literals Procedures
  • 42. Dr. Mahesh R. Sanghavi Unit- I SPOS Machine Structure
  • 43. Dr. Mahesh R. Sanghavi Unit- I SPOS Machine Structure Machine Instruction Format
  • 44. Dr. Mahesh R. Sanghavi Unit- I SPOS Assembler Assembler Pass 1 Assembler Pass 2 Assembler Separate Generate the machine code Determine Storage Requirement Build the Symbol Table Labels Operand Fields Mnemonic Opcode
  • 45. Dr. Mahesh R. Sanghavi Unit- I SPOS Pass 1 Assembler Uses How pass 1 assembler works? Machine opcode Table Symbol Table Pool Table Literal Table Data Structure Pass 1 Assembler ❏ Contents of MOT are fixed for an assembler.
  • 46. Dr. Mahesh R. Sanghavi Unit- I SPOS Apply LC Observe code Pass 1 Assembler
  • 47. Dr. Mahesh R. Sanghavi Unit- I SPOS Symbol Table Construct Pass 1 Assembler
  • 48. Dr. Mahesh R. Sanghavi Unit- I SPOS Construct Literal Table Pass 1 Assembler
  • 49. Dr. Mahesh R. Sanghavi Unit- I SPOS Pool table contains starting literal(index ) of each pool. Pool Table Pass 1 Assembler
  • 50. Dr. Mahesh R. Sanghavi Unit- I SPOS | Construct Machine Code Intermediate Code Machine opcode Table needs Pass 1 Assembler
  • 51. Dr. Mahesh R. Sanghavi Unit- I SPOS Enhanced Machine Opcode Table Pass 1 Assembler
  • 52. Dr. Mahesh R. Sanghavi Unit- I SPOS Enhanced Machine Opcode Table Pass 1 Assembler
  • 53. Dr. Mahesh R. Sanghavi Unit- I SPOS Intermediate code ❏ For every line of assembly statement, one line of intermediate code is generated ❏ Each mnemonic field is represented as (Statement Class , Machine code) Pass 1 Assembler
  • 54. Dr. Mahesh R. Sanghavi Unit- I SPOS Intermediate code Statement Class Can be IS DS | DC AD MOVER AREG, X Mnemonic Field Operand Field IC for mnemonic field of above line is , (Statement Class , Machine code) ( IS,04 ) From MOT Pass 1 Assembler
  • 55. Dr. Mahesh R. Sanghavi Unit- I SPOS Intermediate code Operand Field S Symbol L Literal RG Register CC Condition Codes C Constant Operand Field ( operand Class , reference ) represented For a symbol or literal the reference field contains the index of the operands entry in symbol table or literal table. START 200 (AD, 01) (C, 200) E.g. MOVER AREG, X (IS, 04) (RG, 01) (S, 0) Mnemonic code Pass 1 Assembler
  • 56. Dr. Mahesh R. Sanghavi Unit- I SPOS Intermediate code
  • 57. Dr. Mahesh R. Sanghavi Unit- I SPOS Example 2 Assignment
  • 58.
  • 59.
  • 60. Dr. Mahesh R. Sanghavi Unit- I SPOS Outline ❏ Review of previous session ❏ Pass 2 Assembler
  • 61.
  • 62. Dr. Mahesh R. Sanghavi Unit- I SPOS Pass 2 Assembler Pass 2 Assembler Intermediate code Machine Code Pass 2 Assembler ❏ Processes the intermediate representation (IR) to synthesize the target program.
  • 63. Dr. Mahesh R. Sanghavi Unit- I SPOS Pass 2 Assembler Pass 2 Assembler Data Structure Pass I Pass II Intermediate code Source Program Target Program Data Access Control transfer
  • 64. Dr. Mahesh R. Sanghavi Unit- I SPOS Pass 2 Assembler Analysis Phase Synthesis Phase Vs
  • 66. Unit- I SPOS Assembler Dr. Mahesh R. Sanghavi Pass 1 Pass 2 Intermediate Code Machine Code Output of Pass 1 | Pass 2 Assembler Generates Generates
  • 67. Unit- I SPOS Assembler Dr. Mahesh R. Sanghavi Variants Variants I Variants II Variants of Intermediate Code
  • 68. Unit- I SPOS Assembler Dr. Mahesh R. Sanghavi Variants I Variants of Intermediate Code In Variant I, each operand is represented by a pair of the form (operand class, code). The operand class is one of: 1. S for symbol 2. L for literal 3. C for constant 4. RG for register.
  • 69. Unit- I SPOS Assembler Dr. Mahesh R. Sanghavi Variants I Variants of Intermediate Code
  • 70. Unit- I SPOS Assembler Dr. Mahesh R. Sanghavi Variants II Variants of Intermediate Code In variant II, operands are processed selectively. Constants and literals are processed. Symbols, condition codes and CPU registers are not processed.
  • 71. Unit- I SPOS Assembler Dr. Mahesh R. Sanghavi Variants II Variants of Intermediate Code