SlideShare a Scribd company logo
1 of 14
ASSEMBLY LANGUAGE
1
 Machine instructions are represented by patterns of 0’s and
1’s
 Use of symbolic words – Move, Add, Increment, Branch etc
 When writing programs such words are replaced by
acronyms called mnemonics like MOV, ADD, INC, BR.
 R3 to represent register 3 and LOC to refer to a memory
location
 Assembly language – A complete set of such symbolic names
and rules for their use constitute a programming language
 Syntax – set of rules
2
3
 Assembler – A program that automatically translates the programs
written in an assembly language into a sequence of machine
instructions
 It is one of a collection of utility programs.
 User program in original alphanumeric text format is source
program
 Assembled language program is called object program
 Assembly language program may or may not be case sensitive.
4
 Example
MOVE R0,SUM
 Mnemonic MOVE represents the binary pattern or op code for the
operation
 Assembler translates this mnemonic into binary op code that
computer understands
 Op code followed by operands information (source, destination)
 Here, Source operand …………??????
Destination operand …………??????
5
 Since there are several possible addressing modes for specifying operand
locations, assemble language should indicate the mode
 For example,
ADD #5,R3
In some assemble language this can be denoted by indented op code
mnemonic
ADDI 5,R3
 Indirect addressing modes is specified by putting in ( ),
 For example,
MOVE #5,(R2)
or
Assembler Directives
6
 In addition to providing a mechanism for representing
instructions in a program, the assemble language allows the
programmer to specify other information needed for
translation
 Suppose SUM is used to represent the value 200
SUM EQU 200
 It simply informs the assembler that the name SUM should
replace the value 200 whenever it appears in the program
 Assembler Directives (Or commands)
7
It shows the memory addresses
where the machine instructions
and the required data items are
to be found after the program
loaded for execution.
8
 Assembler has to know
 How to interpret the names
 Where to place the instructions in the memory
 Where to place the data operands in the memory
9
 Program begins with Assembler Directives
 EQU
 ORIGIN
 DATAWORD
 RESERVE
 RETURN
 END
RETURN – idenfies the point at which the execution of the program should be
terminated.
It causes the assembler to insert an appropriate machine instruction that
returns control to the OS
10
 Most assemble languages requires statements in a source program to
be written as
Label Operation Operand(s) Comment
 Separated by an appropriate delimiter, one or more blank characters.
 Label – optional name associated with the memory address where the
machine language instruction produced from the statement will be
loaded. Also associated with address of the data items
 Operation – op code muemonic or assembler directives
 Operand – addressing information of the operands
 Comment – ignored by the assembler program (only for documentation
purpose)
Assembly and Execution of
Programs
11
 Key part of the assembly process is determining the values to
replace the names.
 In some cases the value is specified by EQU directive
 Other case, a name is defined in the Label field of a given
instruction
 Hence assembler must keep track of address it generates the
machine code for successive instructions
 In some cases assembler does not directly replace a name
representing an address with the actual value
 Example in branch instructions – Branch target using Relative
addressing mode (branch offset)
12
 Symbol table – it keeps all names and numerical values that
correspond to them while scanning the source program.
 Problem arises when a name appears as an operand before it is given
a value.
 This happens if a forward branch is required.
 A simple solution is to have the assembler scan through the source
program twice.
 During the first pass, it creates a complete symbol table and assigns
numerical value for all names at the end of the pass
 The assembler then goes through the source program a second time
and substitutes values for all names from the symbol table
 Two-pass assembler
13
 Assembler stores the program in the magnetic disk
 Loader – another utility program that loads the object
program into the memory of a computer before it is
executed
 Loader must know the length of the program and the
address in the memory where it will be stored
 Debugger – helps the user to find programming errors
Number Notation
14
 Numerical values are stored as binary values.
 Most assembler allows numerical values to be specified in
different ways defined by assembly language syntax
 For example,
ADD #93,R1
Can be represented as
ADD #%01011101,R1
In Hexadecimal
ADD #$5D,R1

More Related Content

Similar to Assembly language.pptx

01. Introduction.ppt
01. Introduction.ppt01. Introduction.ppt
01. Introduction.pptReshmaR57
 
Assembly language
Assembly languageAssembly language
Assembly languagegaurav jain
 
Compliers and interpreters
Compliers and interpretersCompliers and interpreters
Compliers and interpretersshivasdhtsvmic
 
Computer and programing basics.pptx
Computer and programing basics.pptxComputer and programing basics.pptx
Computer and programing basics.pptxgaafergoda
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Sehrish Rafiq
 
Cs6660 compiler design
Cs6660 compiler designCs6660 compiler design
Cs6660 compiler designhari2010
 
Concept of compiler in details
Concept of compiler in detailsConcept of compiler in details
Concept of compiler in detailskazi_aihtesham
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languagesraksharao
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programmingMakerere university
 
Programming basic computer
Programming basic computerProgramming basic computer
Programming basic computerMartial Kouadio
 
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.pdfDrIsikoIsaac
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit ISaranya1702
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Urvashi Singh
 
microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfPriyankaRana171346
 

Similar to Assembly language.pptx (20)

01. Introduction.ppt
01. Introduction.ppt01. Introduction.ppt
01. Introduction.ppt
 
Assembly language
Assembly languageAssembly language
Assembly language
 
Compliers and interpreters
Compliers and interpretersCompliers and interpreters
Compliers and interpreters
 
Assembly
AssemblyAssembly
Assembly
 
Chapter#01 cc
Chapter#01 ccChapter#01 cc
Chapter#01 cc
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
Assembler
AssemblerAssembler
Assembler
 
Computer and programing basics.pptx
Computer and programing basics.pptxComputer and programing basics.pptx
Computer and programing basics.pptx
 
Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12Introduction to Computers Lecture # 12
Introduction to Computers Lecture # 12
 
Cs6660 compiler design
Cs6660 compiler designCs6660 compiler design
Cs6660 compiler design
 
Concept of compiler in details
Concept of compiler in detailsConcept of compiler in details
Concept of compiler in details
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languages
 
Assemblers .pdf.pptx
Assemblers .pdf.pptxAssemblers .pdf.pptx
Assemblers .pdf.pptx
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programming
 
Programming basic computer
Programming basic computerProgramming basic computer
Programming basic computer
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
 
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
 
System Programming- Unit I
System Programming- Unit ISystem Programming- Unit I
System Programming- Unit I
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086
 
microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdf
 

Recently uploaded

MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 

Recently uploaded (20)

MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 

Assembly language.pptx

  • 2.  Machine instructions are represented by patterns of 0’s and 1’s  Use of symbolic words – Move, Add, Increment, Branch etc  When writing programs such words are replaced by acronyms called mnemonics like MOV, ADD, INC, BR.  R3 to represent register 3 and LOC to refer to a memory location  Assembly language – A complete set of such symbolic names and rules for their use constitute a programming language  Syntax – set of rules 2
  • 3. 3  Assembler – A program that automatically translates the programs written in an assembly language into a sequence of machine instructions  It is one of a collection of utility programs.  User program in original alphanumeric text format is source program  Assembled language program is called object program  Assembly language program may or may not be case sensitive.
  • 4. 4  Example MOVE R0,SUM  Mnemonic MOVE represents the binary pattern or op code for the operation  Assembler translates this mnemonic into binary op code that computer understands  Op code followed by operands information (source, destination)  Here, Source operand …………?????? Destination operand …………??????
  • 5. 5  Since there are several possible addressing modes for specifying operand locations, assemble language should indicate the mode  For example, ADD #5,R3 In some assemble language this can be denoted by indented op code mnemonic ADDI 5,R3  Indirect addressing modes is specified by putting in ( ),  For example, MOVE #5,(R2) or
  • 6. Assembler Directives 6  In addition to providing a mechanism for representing instructions in a program, the assemble language allows the programmer to specify other information needed for translation  Suppose SUM is used to represent the value 200 SUM EQU 200  It simply informs the assembler that the name SUM should replace the value 200 whenever it appears in the program  Assembler Directives (Or commands)
  • 7. 7 It shows the memory addresses where the machine instructions and the required data items are to be found after the program loaded for execution.
  • 8. 8  Assembler has to know  How to interpret the names  Where to place the instructions in the memory  Where to place the data operands in the memory
  • 9. 9  Program begins with Assembler Directives  EQU  ORIGIN  DATAWORD  RESERVE  RETURN  END RETURN – idenfies the point at which the execution of the program should be terminated. It causes the assembler to insert an appropriate machine instruction that returns control to the OS
  • 10. 10  Most assemble languages requires statements in a source program to be written as Label Operation Operand(s) Comment  Separated by an appropriate delimiter, one or more blank characters.  Label – optional name associated with the memory address where the machine language instruction produced from the statement will be loaded. Also associated with address of the data items  Operation – op code muemonic or assembler directives  Operand – addressing information of the operands  Comment – ignored by the assembler program (only for documentation purpose)
  • 11. Assembly and Execution of Programs 11  Key part of the assembly process is determining the values to replace the names.  In some cases the value is specified by EQU directive  Other case, a name is defined in the Label field of a given instruction  Hence assembler must keep track of address it generates the machine code for successive instructions  In some cases assembler does not directly replace a name representing an address with the actual value  Example in branch instructions – Branch target using Relative addressing mode (branch offset)
  • 12. 12  Symbol table – it keeps all names and numerical values that correspond to them while scanning the source program.  Problem arises when a name appears as an operand before it is given a value.  This happens if a forward branch is required.  A simple solution is to have the assembler scan through the source program twice.  During the first pass, it creates a complete symbol table and assigns numerical value for all names at the end of the pass  The assembler then goes through the source program a second time and substitutes values for all names from the symbol table  Two-pass assembler
  • 13. 13  Assembler stores the program in the magnetic disk  Loader – another utility program that loads the object program into the memory of a computer before it is executed  Loader must know the length of the program and the address in the memory where it will be stored  Debugger – helps the user to find programming errors
  • 14. Number Notation 14  Numerical values are stored as binary values.  Most assembler allows numerical values to be specified in different ways defined by assembly language syntax  For example, ADD #93,R1 Can be represented as ADD #%01011101,R1 In Hexadecimal ADD #$5D,R1