SlideShare a Scribd company logo
Assembly language
What is Assembly Language?
Each personal computer has a microprocessor that manages the
computer's arithmetical, logical, and control activities.
Each family of processors has its own set of instructions for
handling various operations such as getting input from keyboard,
displaying information on screen and performing various other jobs.
These set of instructions are called 'machine language instructions'.
A processor understands only machine language instructions,
which are strings of 1's and 0's. However, machine language is too
obscure and complex for using in software development. So, the low-
level assembly language is designed for a specific family of processors
that represents various instructions in symbolic code and a more
understandable form.
Assembly language
Why is ASM useful?
Machine language is just a series of numbers, which is not easy for
humans to read. Using ASM, programmers can write human-
readable programs that correspond almost exactly to machine
language.
The disadvantage is that everything the computer does must be
described explicitly, in precise detail. The advantage is that the
programmer has maximum control over what the computer is
doing.
Why is ASM a "low-level" language?
Assembly is called a low-level programming language because
there is (nearly) a one-to-one relationship between what it tells
the computer to do, and what the computer does. In general, one
line of an assembly program contains a maximum of one
instruction for the computer.
Assembly language
How is ASM different from a "high-level" language?
High-level languages provide abstractions of low-level operations
which allow the programmer to focus more on describing what
they want to do, and less on how it should be done. Programming
this way is more convenient and makes programs easier to read at
the sacrifice of low-level control.
Is ASM portable?
No. Because assembly languages are tied to one specific computer
architecture, they are not portable. A program written in one
assembly language would need to be completely rewritten for it to
run on another type of machine.
Assembly language
Advantages of Assembly Language
Having an understanding of assembly language makes one
aware of −
How programs interface with OS, processor, and BIOS;
How data is represented in memory and other external devices;
How the processor accesses and executes instruction;
How instructions access and process data;
How a program accesses external devices.
Other advantages of using assembly language are −
It requires less memory and execution time;
It allows hardware-specific complex jobs in an easier way;
It is suitable for time-critical jobs;
It is most suitable for writing interrupt service routines and
other memory resident programs.
Assembly language
An assembly language program can be divided into 3 sections:-
The data section
The bss section
The text section
The data Section
The data section is used for declaring initialized data or constants.
This data does not change at runtime. You can declare various
constant values, file names, or buffer size, etc., in this section.
The syntax for declaring data section is −
section.data
The bss Section
The bss section is used for declaring variables. The syntax for
declaring bss section is −
section.bss
Assembly language
The text section
The text section is used for keeping the actual code. This section
must begin with the declaration global _start, which tells the
kernel where the program execution begins.
The syntax for declaring text section is −
section.text global _start _start:
how it works:
Most computers come with a specified set of very basic
instructions that correspond to the basic machine operations that
the computer can perform. For example, a "Load" instruction
causes the processor to move a string of bits from a location in the
processor's memory to a special holding place called a register.
Assembly language
Assuming the processor has at least eight registers, each
numbered, the following instruction would move the value (string
of bits of a certain length) at memory location 3000 into the
holding place called register 8:
 The programmer can write a program using a sequence of these
assembler instructions.
This sequence of assembler instructions, known as the
source code or source program, is then specified to the assembler
program when that program is started.
The assembler program takes each program statement in the
source program and generates a corresponding bit stream or
pattern (a series of 0's and 1's of a given length).
L 8,3000
Assembly language
The output of the assembler program is called the object code or
object program relative to the input source program. The
sequence of 0's and 1's that constitute the object program is
sometimes called machine code.
The object program can then be run (or executed) whenever
desired.
Assembler
An assembler is a program that takes basic computer instructions
and converts them into a pattern of bits that the
computer's processor can use to perform its basic operations.
Some people call these instructions assembler language and
others use the term assembly language.
Assembly language
While assembly languages differ between processor architectures, they often
include similar instructions and operators. Below are some examples of
instructions supported by x86 processors.
• MOV - move data from one location to another
• ADD - add two values
• SUB - subtract a value from another value
• PUSH - push data onto a stack
• POP - pop data from a stack
• JMP - jump to another location
• INT - interrupt a process
the following assembly language can be used to add the numbers 3 and 4:
mov eax, 3 - loads 3 into the register "eax"
mov ebx, 4 - loads 4 into the register "ebx"
add eax, ebx, ecx - adds "eax" and "ebx" and stores the result (7) in "ecx"
Assembly language
limitations of assembly language
• No Symbolic names for memory locations. You need to keep track of the exact
memory location that a piece of data is stored. That is, you must manipulate
memory locations directly.
• Hard to read. Although we've made a few improvements by eliminating hex
code, the command names are not always clear.
• Code is still machine dependent. We haven't really moved that far away from
the machine language - just put psuedo-English labels on it. We still need to
rewrite every piece of code for every machine.
• Hard to maintain and debug. Finding mistakes in machine code is difficult.
Correcting them or adding new features can also be a challenge.
• Code must be heavily documented. It's very difficult (if not impossible) to figure
out what a program does by reading the code. Detailed explanation must be
prepared for future coders (including the original programmer) who need to
modify or use the code.

More Related Content

What's hot

Von-Neumann machine and IAS architecture
Von-Neumann machine and  IAS architectureVon-Neumann machine and  IAS architecture
Von-Neumann machine and IAS architecture
Shishir Aryal
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
PreethiSureshkumar1
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
Suvendu Kumar Dash
 
computer languages
computer languagescomputer languages
computer languages
Rajendran
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
United International University
 
High level and Low level Language
High level and Low level Language High level and Low level Language
High level and Low level Language
adnan usmani
 
System programming
System programmingSystem programming
System programming
jayashri kolekar
 
Stored program concept
Stored program conceptStored program concept
Stored program concept
gaurav jain
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
Bansari Shah
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computersBảo Hoang
 
Basic Computer Architecture
Basic Computer ArchitectureBasic Computer Architecture
Basic Computer Architecture
Yong Heui Cho
 
Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
Er Sangita Vishwakarma
 
computer Architecture
computer Architecturecomputer Architecture
computer Architecture
umardanjumamaiwada
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
Zubair Khalid
 
Computer registers
Computer registersComputer registers
Computer registers
Jatin Grover
 
Lec 2 algorithms efficiency complexity
Lec 2 algorithms efficiency  complexityLec 2 algorithms efficiency  complexity
Lec 2 algorithms efficiency complexity
Anaya Zafar
 
Computer registers
Computer registersComputer registers
Computer registers
DeepikaT13
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
Kamal Acharya
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
Ashhad Kamal
 

What's hot (20)

Von-Neumann machine and IAS architecture
Von-Neumann machine and  IAS architectureVon-Neumann machine and  IAS architecture
Von-Neumann machine and IAS architecture
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
computer languages
computer languagescomputer languages
computer languages
 
Intro to assembly language
Intro to assembly languageIntro to assembly language
Intro to assembly language
 
High level and Low level Language
High level and Low level Language High level and Low level Language
High level and Low level Language
 
System programming
System programmingSystem programming
System programming
 
Stored program concept
Stored program conceptStored program concept
Stored program concept
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computers
 
Basic Computer Architecture
Basic Computer ArchitectureBasic Computer Architecture
Basic Computer Architecture
 
Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
 
computer Architecture
computer Architecturecomputer Architecture
computer Architecture
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Direct memory access (dma)
Direct memory access (dma)Direct memory access (dma)
Direct memory access (dma)
 
Computer registers
Computer registersComputer registers
Computer registers
 
Lec 2 algorithms efficiency complexity
Lec 2 algorithms efficiency  complexityLec 2 algorithms efficiency  complexity
Lec 2 algorithms efficiency complexity
 
Computer registers
Computer registersComputer registers
Computer registers
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 

Similar to Assembly language

Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
Abdul Khan
 
ASSEMBLY LANGUAGE.pptx
ASSEMBLY LANGUAGE.pptxASSEMBLY LANGUAGE.pptx
ASSEMBLY LANGUAGE.pptx
EdFeranil
 
microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdf
PriyankaRana171346
 
Assembly chapter One.pptx
Assembly chapter One.pptxAssembly chapter One.pptx
Assembly chapter One.pptx
ssuserb78e291
 
Introduction to Assembly Language Programming
Introduction to Assembly Language ProgrammingIntroduction to Assembly Language Programming
Introduction to Assembly Language Programming
Rahul P
 
1 Describe different types of Assemblers.Assembly language.docx
 1 Describe different types of Assemblers.Assembly language.docx 1 Describe different types of Assemblers.Assembly language.docx
1 Describe different types of Assemblers.Assembly language.docx
aryan532920
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
Keerty Smile
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)Ashim Saha
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langauge
mustafkhalid
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
tharwatabdulhmed
 
Ayushi
AyushiAyushi
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdf
KINGZzofYouTube
 
Perfect papers software
Perfect papers   softwarePerfect papers   software
Perfect papers softwareguest0a1ce99
 
Computer languages
Computer languagesComputer languages
Computer languages
Buxoo Abdullah
 
02_Intro to Programming Language.pptx
02_Intro to Programming Language.pptx02_Intro to Programming Language.pptx
02_Intro to Programming Language.pptx
JhunBrianAndam
 
Block diagram (computer programming & utilization)
Block diagram (computer programming & utilization)Block diagram (computer programming & utilization)
Block diagram (computer programming & utilization)
Digvijaysinh Gohil
 
a1.pptx.pdf
a1.pptx.pdfa1.pptx.pdf
a1.pptx.pdf
Sheham Hassan
 
Language translators
Language translatorsLanguage translators
Language translatorsAditya Sharat
 
Software Concepts Notes
Software Concepts NotesSoftware Concepts Notes
Software Concepts Notes
Prof. Dr. K. Adisesha
 

Similar to Assembly language (20)

Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
ASSEMBLY LANGUAGE.pptx
ASSEMBLY LANGUAGE.pptxASSEMBLY LANGUAGE.pptx
ASSEMBLY LANGUAGE.pptx
 
microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdf
 
Assembly chapter One.pptx
Assembly chapter One.pptxAssembly chapter One.pptx
Assembly chapter One.pptx
 
Assembly
AssemblyAssembly
Assembly
 
Introduction to Assembly Language Programming
Introduction to Assembly Language ProgrammingIntroduction to Assembly Language Programming
Introduction to Assembly Language Programming
 
1 Describe different types of Assemblers.Assembly language.docx
 1 Describe different types of Assemblers.Assembly language.docx 1 Describe different types of Assemblers.Assembly language.docx
1 Describe different types of Assemblers.Assembly language.docx
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langauge
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
Ayushi
AyushiAyushi
Ayushi
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdf
 
Perfect papers software
Perfect papers   softwarePerfect papers   software
Perfect papers software
 
Computer languages
Computer languagesComputer languages
Computer languages
 
02_Intro to Programming Language.pptx
02_Intro to Programming Language.pptx02_Intro to Programming Language.pptx
02_Intro to Programming Language.pptx
 
Block diagram (computer programming & utilization)
Block diagram (computer programming & utilization)Block diagram (computer programming & utilization)
Block diagram (computer programming & utilization)
 
a1.pptx.pdf
a1.pptx.pdfa1.pptx.pdf
a1.pptx.pdf
 
Language translators
Language translatorsLanguage translators
Language translators
 
Software Concepts Notes
Software Concepts NotesSoftware Concepts Notes
Software Concepts Notes
 

More from gaurav jain

Basic ops concept of comp
Basic ops  concept of compBasic ops  concept of comp
Basic ops concept of comp
gaurav jain
 
Functional units of computer
Functional units of computerFunctional units of computer
Functional units of computer
gaurav jain
 
Programming languages
Programming languagesProgramming languages
Programming languages
gaurav jain
 
Comprehensive interventions
Comprehensive interventionsComprehensive interventions
Comprehensive interventions
gaurav jain
 
Personal intervention
Personal interventionPersonal intervention
Personal intervention
gaurav jain
 
Od interventions
Od interventionsOd interventions
Od interventions
gaurav jain
 
Interpersonal and group process interventions
Interpersonal and group process interventionsInterpersonal and group process interventions
Interpersonal and group process interventions
gaurav jain
 
Organizational effectiveness
Organizational effectivenessOrganizational effectiveness
Organizational effectiveness
gaurav jain
 
Organizational change and development
Organizational change and developmentOrganizational change and development
Organizational change and development
gaurav jain
 
Definition and nature of organizational development
Definition and nature of organizational developmentDefinition and nature of organizational development
Definition and nature of organizational development
gaurav jain
 
Change agent
Change agentChange agent
Change agent
gaurav jain
 
Service sector and economic, growth
Service sector and economic, growthService sector and economic, growth
Service sector and economic, growth
gaurav jain
 
Service concept, characteristic and classification
Service concept, characteristic and classificationService concept, characteristic and classification
Service concept, characteristic and classification
gaurav jain
 
Relationship marketing concept, process and importance
Relationship marketing concept, process and importanceRelationship marketing concept, process and importance
Relationship marketing concept, process and importance
gaurav jain
 
Marketing for non profit organizations
Marketing for non profit organizationsMarketing for non profit organizations
Marketing for non profit organizations
gaurav jain
 
Creating and delivering services
Creating and delivering servicesCreating and delivering services
Creating and delivering services
gaurav jain
 
Securing the e marketing site
Securing  the e marketing siteSecuring  the e marketing site
Securing the e marketing site
gaurav jain
 
Ongoing customer communication in e marketing
Ongoing customer communication in e marketingOngoing customer communication in e marketing
Ongoing customer communication in e marketing
gaurav jain
 
Ethics of electronic marketing
Ethics of electronic marketingEthics of electronic marketing
Ethics of electronic marketing
gaurav jain
 
Electronic marketing mix strategies
Electronic marketing mix strategiesElectronic marketing mix strategies
Electronic marketing mix strategies
gaurav jain
 

More from gaurav jain (20)

Basic ops concept of comp
Basic ops  concept of compBasic ops  concept of comp
Basic ops concept of comp
 
Functional units of computer
Functional units of computerFunctional units of computer
Functional units of computer
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Comprehensive interventions
Comprehensive interventionsComprehensive interventions
Comprehensive interventions
 
Personal intervention
Personal interventionPersonal intervention
Personal intervention
 
Od interventions
Od interventionsOd interventions
Od interventions
 
Interpersonal and group process interventions
Interpersonal and group process interventionsInterpersonal and group process interventions
Interpersonal and group process interventions
 
Organizational effectiveness
Organizational effectivenessOrganizational effectiveness
Organizational effectiveness
 
Organizational change and development
Organizational change and developmentOrganizational change and development
Organizational change and development
 
Definition and nature of organizational development
Definition and nature of organizational developmentDefinition and nature of organizational development
Definition and nature of organizational development
 
Change agent
Change agentChange agent
Change agent
 
Service sector and economic, growth
Service sector and economic, growthService sector and economic, growth
Service sector and economic, growth
 
Service concept, characteristic and classification
Service concept, characteristic and classificationService concept, characteristic and classification
Service concept, characteristic and classification
 
Relationship marketing concept, process and importance
Relationship marketing concept, process and importanceRelationship marketing concept, process and importance
Relationship marketing concept, process and importance
 
Marketing for non profit organizations
Marketing for non profit organizationsMarketing for non profit organizations
Marketing for non profit organizations
 
Creating and delivering services
Creating and delivering servicesCreating and delivering services
Creating and delivering services
 
Securing the e marketing site
Securing  the e marketing siteSecuring  the e marketing site
Securing the e marketing site
 
Ongoing customer communication in e marketing
Ongoing customer communication in e marketingOngoing customer communication in e marketing
Ongoing customer communication in e marketing
 
Ethics of electronic marketing
Ethics of electronic marketingEthics of electronic marketing
Ethics of electronic marketing
 
Electronic marketing mix strategies
Electronic marketing mix strategiesElectronic marketing mix strategies
Electronic marketing mix strategies
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 

Assembly language

  • 1. Assembly language What is Assembly Language? Each personal computer has a microprocessor that manages the computer's arithmetical, logical, and control activities. Each family of processors has its own set of instructions for handling various operations such as getting input from keyboard, displaying information on screen and performing various other jobs. These set of instructions are called 'machine language instructions'. A processor understands only machine language instructions, which are strings of 1's and 0's. However, machine language is too obscure and complex for using in software development. So, the low- level assembly language is designed for a specific family of processors that represents various instructions in symbolic code and a more understandable form.
  • 2. Assembly language Why is ASM useful? Machine language is just a series of numbers, which is not easy for humans to read. Using ASM, programmers can write human- readable programs that correspond almost exactly to machine language. The disadvantage is that everything the computer does must be described explicitly, in precise detail. The advantage is that the programmer has maximum control over what the computer is doing. Why is ASM a "low-level" language? Assembly is called a low-level programming language because there is (nearly) a one-to-one relationship between what it tells the computer to do, and what the computer does. In general, one line of an assembly program contains a maximum of one instruction for the computer.
  • 3. Assembly language How is ASM different from a "high-level" language? High-level languages provide abstractions of low-level operations which allow the programmer to focus more on describing what they want to do, and less on how it should be done. Programming this way is more convenient and makes programs easier to read at the sacrifice of low-level control. Is ASM portable? No. Because assembly languages are tied to one specific computer architecture, they are not portable. A program written in one assembly language would need to be completely rewritten for it to run on another type of machine.
  • 4. Assembly language Advantages of Assembly Language Having an understanding of assembly language makes one aware of − How programs interface with OS, processor, and BIOS; How data is represented in memory and other external devices; How the processor accesses and executes instruction; How instructions access and process data; How a program accesses external devices. Other advantages of using assembly language are − It requires less memory and execution time; It allows hardware-specific complex jobs in an easier way; It is suitable for time-critical jobs; It is most suitable for writing interrupt service routines and other memory resident programs.
  • 5. Assembly language An assembly language program can be divided into 3 sections:- The data section The bss section The text section The data Section The data section is used for declaring initialized data or constants. This data does not change at runtime. You can declare various constant values, file names, or buffer size, etc., in this section. The syntax for declaring data section is − section.data The bss Section The bss section is used for declaring variables. The syntax for declaring bss section is − section.bss
  • 6. Assembly language The text section The text section is used for keeping the actual code. This section must begin with the declaration global _start, which tells the kernel where the program execution begins. The syntax for declaring text section is − section.text global _start _start: how it works: Most computers come with a specified set of very basic instructions that correspond to the basic machine operations that the computer can perform. For example, a "Load" instruction causes the processor to move a string of bits from a location in the processor's memory to a special holding place called a register.
  • 7. Assembly language Assuming the processor has at least eight registers, each numbered, the following instruction would move the value (string of bits of a certain length) at memory location 3000 into the holding place called register 8:  The programmer can write a program using a sequence of these assembler instructions. This sequence of assembler instructions, known as the source code or source program, is then specified to the assembler program when that program is started. The assembler program takes each program statement in the source program and generates a corresponding bit stream or pattern (a series of 0's and 1's of a given length). L 8,3000
  • 8. Assembly language The output of the assembler program is called the object code or object program relative to the input source program. The sequence of 0's and 1's that constitute the object program is sometimes called machine code. The object program can then be run (or executed) whenever desired. Assembler An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the computer's processor can use to perform its basic operations. Some people call these instructions assembler language and others use the term assembly language.
  • 9. Assembly language While assembly languages differ between processor architectures, they often include similar instructions and operators. Below are some examples of instructions supported by x86 processors. • MOV - move data from one location to another • ADD - add two values • SUB - subtract a value from another value • PUSH - push data onto a stack • POP - pop data from a stack • JMP - jump to another location • INT - interrupt a process the following assembly language can be used to add the numbers 3 and 4: mov eax, 3 - loads 3 into the register "eax" mov ebx, 4 - loads 4 into the register "ebx" add eax, ebx, ecx - adds "eax" and "ebx" and stores the result (7) in "ecx"
  • 10. Assembly language limitations of assembly language • No Symbolic names for memory locations. You need to keep track of the exact memory location that a piece of data is stored. That is, you must manipulate memory locations directly. • Hard to read. Although we've made a few improvements by eliminating hex code, the command names are not always clear. • Code is still machine dependent. We haven't really moved that far away from the machine language - just put psuedo-English labels on it. We still need to rewrite every piece of code for every machine. • Hard to maintain and debug. Finding mistakes in machine code is difficult. Correcting them or adding new features can also be a challenge. • Code must be heavily documented. It's very difficult (if not impossible) to figure out what a program does by reading the code. Detailed explanation must be prepared for future coders (including the original programmer) who need to modify or use the code.