SlideShare une entreprise Scribd logo
1  sur  20
Assembly Language
Here’s what a program-fragment looks like:
10100001
00001000
10010011
11000000
It means:

10111100
00000011
00000100
10010100

10010011
00000101
00001000
00000100

z = x + y;

00000100
11000000
10100011
00001000


Machine language
 Native to a processor: executed directly by hardware
 Instructions consist of binary code: 1s and 0s



Assembly language
 A programming language that uses symbolic names to represent
operations, registers and memory locations.
 Slightly higher-level language

 Readability of instructions is better than machine language
 One-to-one correspondence with machine language instructions


Assemblers translate assembly to machine code



Compilers translate high-level programs to machine code
 Either directly, or
 Indirectly via an assembler
 Software tools are needed for editing, assembling, linking,
and debugging assembly language programs
 An assembler is a program that converts source-code
programs written in assembly language into object files in
machine language
 Popular assemblers have emerged over the years for the
Intel family of processors. These include …
 TASM (Turbo Assembler from Borland)
 NASM (Netwide Assembler for both Windows and Linux), and
 GNU assembler distributed by the free software foundation


In assembly language, mnemonics are used
to specify an opcode that represents a
complete and operational machine language
instruction. This is later translated by the
assembler to generate the object code. For
example, the mnemonic MOV is used in
assembly language for copying and moving
data between registers and memory
locations.


Each command of a program is called an instruction (it
instructs the computer what to do).



Computers only deal with binary data, hence the
instructions must be in binary format (0s and 1s) .



The set of all instructions (in binary form) makes up the
computer's machine language. This is also referred to as
the instruction set.


Machine language instructions usually are made up of
several fields. Each field specifies different information
for the computer. The major two fields are:



Opcode field which stands for operation code and it
specifies the particular operation that is to be performed.
 Each operation has its unique opcode.



Operands fields which specify where to get the source
and destination operands for the operation specified by
the opcode.
 The source/destination of operands can be a constant, the
memory or one of the general-purpose registers.


Built from two pieces
Add R1, R3, 3

Opcode
What to do
with the data
(ALU
operation)

Operands
Where to
get data and
put the
results


Arithmetic, logical
◦ add, sub, mult
◦ and, or
◦ Cmp



Memory load/store



Control transfer

◦ ld, st
◦ jmp
◦ bne



Complex
◦ movs
Each operand taken from a particular
addressing mode:
 Examples:
Register
add r1, r2, r3
Immediate
add r1, r2, 10
Indirect
mov r1, (r2)
Offset
mov r1, 10(r3)
PC Relative
beq 100




Reflect processor data pathways


ASCII, American Standard Code for
Information Interchange, is a scheme used for
assigning numeric values to punctuation
marks, spaces, numbers and other
characters. ASCII uses 7 bits to represent
characters. The values 000 0000 through 111
1111 or 00 through 7F are used giving ASCII
the ability to represent 128 different
characters. An extended version of ASCII
assigns characters from 80 through FF.


Accessibility to system hardware
 Assembly Language is useful for implementing system software
 Also useful for small embedded system applications



Space and Time efficiency
 Understanding sources of program inefficiency

 Tuning program performance
 Writing compact code


Writing assembly programs gives the computer designer the needed
deep understanding of the instruction set and how to design one



To be able to write compilers for HLLs, we need to be expert with
the machine language. Assembly programming provides this
experience
1.
2.
3.

4.

Shows how program interfaces with the processor,
operating system, and BIOS.
Shows how data is represented and stored in
memory and on external devices.
Clarifies how processor accesses and executes
instructions and how instructions access and
process data.
Clarifies how a program accesses external devices.


1. Assembly Language is used when speed and
reliability are the overriding factor like small
footprint real-time operating systems.
2. By using assembly language, programmers can
maximize on speed to a level. It is easy to write
than machine code programs.
3. It allows the programmer access to registers or
instructions that are not usually provided by a
High-level language.
4. The main Application of Assembly Language is
for direct hardware manipulation i.e. device
drivers.
5. Assembly language also directly correlates
which machine instructions; the only way to get
closer to the machine is to write in binary or hex
code.
Assembly Language
Assembly Language

Contenu connexe

Tendances (20)

Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
memory hierarchy
memory hierarchymemory hierarchy
memory hierarchy
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Computer system bus
Computer system busComputer system bus
Computer system bus
 
Stack organization
Stack organizationStack organization
Stack organization
 
Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
 
ROM(Read Only Memory )
ROM(Read Only Memory )ROM(Read Only Memory )
ROM(Read Only Memory )
 
Registers and-common-bus
Registers and-common-busRegisters and-common-bus
Registers and-common-bus
 
Instruction format
Instruction formatInstruction format
Instruction format
 
CPU Architecture - Basic
CPU Architecture - BasicCPU Architecture - Basic
CPU Architecture - Basic
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
ADDRESSING MODES
ADDRESSING MODESADDRESSING MODES
ADDRESSING MODES
 
Cache memory
Cache memoryCache memory
Cache memory
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Basic Computer Organization and Design
Basic  Computer  Organization  and  DesignBasic  Computer  Organization  and  Design
Basic Computer Organization and Design
 
Compilers
CompilersCompilers
Compilers
 
register
registerregister
register
 
Memory organization in computer architecture
Memory organization in computer architectureMemory organization in computer architecture
Memory organization in computer architecture
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
 

En vedette

Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1Motaz Saad
 
Assembly language programming
Assembly language programmingAssembly language programming
Assembly language programminghimhk
 
assembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUassembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUEducation
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGFrankie Jones
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 
Assembly level language
Assembly level languageAssembly level language
Assembly level languagePDFSHARE
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Bilal Amjad
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programmingKartik Sharma
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly languageMir Majid
 
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086techbed
 
Mode of address media
Mode of address   mediaMode of address   media
Mode of address mediaTinaaaxo_
 
MASM -UNIT-III
MASM -UNIT-IIIMASM -UNIT-III
MASM -UNIT-IIIDr.YNM
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructionsihsanjamil
 

En vedette (20)

Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1
 
Assembly language programming
Assembly language programmingAssembly language programming
Assembly language programming
 
assembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YUassembly language programming and organization of IBM PC" by YTHA YU
assembly language programming and organization of IBM PC" by YTHA YU
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
Assembly level language
Assembly level languageAssembly level language
Assembly level language
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
 
Step to program in tasm
Step to program in tasmStep to program in tasm
Step to program in tasm
 
Tasm
TasmTasm
Tasm
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programming
 
Single Pass Assembler
Single Pass AssemblerSingle Pass Assembler
Single Pass Assembler
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
 
1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Mode of address media
Mode of address   mediaMode of address   media
Mode of address media
 
Assembler
AssemblerAssembler
Assembler
 
MASM -UNIT-III
MASM -UNIT-IIIMASM -UNIT-III
MASM -UNIT-III
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
ADDRESSING MODE
ADDRESSING MODEADDRESSING MODE
ADDRESSING MODE
 

Similaire à Assembly Language

microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfPriyankaRana171346
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic conceptsAbdul Khan
 
Assembly chapter One.pptx
Assembly chapter One.pptxAssembly chapter One.pptx
Assembly chapter One.pptxssuserb78e291
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmwareJoel P
 
Introduction To Computer and Java
Introduction To Computer and JavaIntroduction To Computer and Java
Introduction To Computer and JavaPRN USM
 
Introduction to programming principles languages
Introduction to programming principles languagesIntroduction to programming principles languages
Introduction to programming principles languagesFrankie Jones
 
intro to assembly language.pptx
intro to assembly language.pptxintro to assembly language.pptx
intro to assembly language.pptxEdFeranil
 
PPS UNIT 1- R18.docx
PPS UNIT 1- R18.docxPPS UNIT 1- R18.docx
PPS UNIT 1- R18.docxUzma1102
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution pptKeerty Smile
 
1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptxVishwas459764
 
Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Chao-Lung Yang
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)Ashim Saha
 
High Level Language (HLL)
High Level Language (HLL)High Level Language (HLL)
High Level Language (HLL)Maliha Jahan
 
Inroduction System Software -features Types
Inroduction System Software -features TypesInroduction System Software -features Types
Inroduction System Software -features TypesSwapnaliPawar27
 

Similaire à Assembly Language (20)

microprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdfmicroprocesser-140306112352-phpapp01.pdf
microprocesser-140306112352-phpapp01.pdf
 
Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
Assembly chapter One.pptx
Assembly chapter One.pptxAssembly chapter One.pptx
Assembly chapter One.pptx
 
a1.pptx.pdf
a1.pptx.pdfa1.pptx.pdf
a1.pptx.pdf
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmware
 
Software Concepts Notes
Software Concepts NotesSoftware Concepts Notes
Software Concepts Notes
 
Introduction To Computer and Java
Introduction To Computer and JavaIntroduction To Computer and Java
Introduction To Computer and Java
 
Introduction to programming principles languages
Introduction to programming principles languagesIntroduction to programming principles languages
Introduction to programming principles languages
 
intro to assembly language.pptx
intro to assembly language.pptxintro to assembly language.pptx
intro to assembly language.pptx
 
PPS UNIT 1- R18.docx
PPS UNIT 1- R18.docxPPS UNIT 1- R18.docx
PPS UNIT 1- R18.docx
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
Assembly
AssemblyAssembly
Assembly
 
1.Overview of Programming.pptx
1.Overview of Programming.pptx1.Overview of Programming.pptx
1.Overview of Programming.pptx
 
Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)Introduction to Computer Programming (general background)
Introduction to Computer Programming (general background)
 
Assembly language programming(unit 4)
Assembly language programming(unit 4)Assembly language programming(unit 4)
Assembly language programming(unit 4)
 
High Level Language (HLL)
High Level Language (HLL)High Level Language (HLL)
High Level Language (HLL)
 
Inroduction System Software -features Types
Inroduction System Software -features TypesInroduction System Software -features Types
Inroduction System Software -features Types
 
CISY 105 Chapter 1
CISY 105 Chapter 1CISY 105 Chapter 1
CISY 105 Chapter 1
 
A&a&r&n
A&a&r&nA&a&r&n
A&a&r&n
 
aula
aulaaula
aula
 

Dernier

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Dernier (20)

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Assembly Language

  • 2.
  • 3. Here’s what a program-fragment looks like: 10100001 00001000 10010011 11000000 It means: 10111100 00000011 00000100 10010100 10010011 00000101 00001000 00000100 z = x + y; 00000100 11000000 10100011 00001000
  • 4.  Machine language  Native to a processor: executed directly by hardware  Instructions consist of binary code: 1s and 0s  Assembly language  A programming language that uses symbolic names to represent operations, registers and memory locations.  Slightly higher-level language  Readability of instructions is better than machine language  One-to-one correspondence with machine language instructions  Assemblers translate assembly to machine code  Compilers translate high-level programs to machine code  Either directly, or  Indirectly via an assembler
  • 5.
  • 6.  Software tools are needed for editing, assembling, linking, and debugging assembly language programs  An assembler is a program that converts source-code programs written in assembly language into object files in machine language  Popular assemblers have emerged over the years for the Intel family of processors. These include …  TASM (Turbo Assembler from Borland)  NASM (Netwide Assembler for both Windows and Linux), and  GNU assembler distributed by the free software foundation
  • 7.  In assembly language, mnemonics are used to specify an opcode that represents a complete and operational machine language instruction. This is later translated by the assembler to generate the object code. For example, the mnemonic MOV is used in assembly language for copying and moving data between registers and memory locations.
  • 8.  Each command of a program is called an instruction (it instructs the computer what to do).  Computers only deal with binary data, hence the instructions must be in binary format (0s and 1s) .  The set of all instructions (in binary form) makes up the computer's machine language. This is also referred to as the instruction set.
  • 9.  Machine language instructions usually are made up of several fields. Each field specifies different information for the computer. The major two fields are:  Opcode field which stands for operation code and it specifies the particular operation that is to be performed.  Each operation has its unique opcode.  Operands fields which specify where to get the source and destination operands for the operation specified by the opcode.  The source/destination of operands can be a constant, the memory or one of the general-purpose registers.
  • 10.  Built from two pieces Add R1, R3, 3 Opcode What to do with the data (ALU operation) Operands Where to get data and put the results
  • 11.  Arithmetic, logical ◦ add, sub, mult ◦ and, or ◦ Cmp  Memory load/store  Control transfer ◦ ld, st ◦ jmp ◦ bne  Complex ◦ movs
  • 12. Each operand taken from a particular addressing mode:  Examples: Register add r1, r2, r3 Immediate add r1, r2, 10 Indirect mov r1, (r2) Offset mov r1, 10(r3) PC Relative beq 100   Reflect processor data pathways
  • 13.
  • 14.
  • 15.  ASCII, American Standard Code for Information Interchange, is a scheme used for assigning numeric values to punctuation marks, spaces, numbers and other characters. ASCII uses 7 bits to represent characters. The values 000 0000 through 111 1111 or 00 through 7F are used giving ASCII the ability to represent 128 different characters. An extended version of ASCII assigns characters from 80 through FF.
  • 16.  Accessibility to system hardware  Assembly Language is useful for implementing system software  Also useful for small embedded system applications  Space and Time efficiency  Understanding sources of program inefficiency  Tuning program performance  Writing compact code  Writing assembly programs gives the computer designer the needed deep understanding of the instruction set and how to design one  To be able to write compilers for HLLs, we need to be expert with the machine language. Assembly programming provides this experience
  • 17. 1. 2. 3. 4. Shows how program interfaces with the processor, operating system, and BIOS. Shows how data is represented and stored in memory and on external devices. Clarifies how processor accesses and executes instructions and how instructions access and process data. Clarifies how a program accesses external devices.
  • 18.  1. Assembly Language is used when speed and reliability are the overriding factor like small footprint real-time operating systems. 2. By using assembly language, programmers can maximize on speed to a level. It is easy to write than machine code programs. 3. It allows the programmer access to registers or instructions that are not usually provided by a High-level language. 4. The main Application of Assembly Language is for direct hardware manipulation i.e. device drivers. 5. Assembly language also directly correlates which machine instructions; the only way to get closer to the machine is to write in binary or hex code.