SlideShare a Scribd company logo
2
Most read
4
Most read
9
Most read
Assembly Language
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
Assembly Language
 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
Assembly Language
Assembly Language


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

More Related Content

PPTX
Instruction Set Architecture
PPTX
Assembly language
PPTX
Part I:Introduction to assembly language
PDF
Assembly level language
PPTX
Intro to assembly language
PDF
Assembly language 8086
PPT
Assembly Language Basics
PDF
assembly language programming and organization of IBM PC" by YTHA YU
Instruction Set Architecture
Assembly language
Part I:Introduction to assembly language
Assembly level language
Intro to assembly language
Assembly language 8086
Assembly Language Basics
assembly language programming and organization of IBM PC" by YTHA YU

What's hot (20)

PPS
Cache memory
PPTX
Interrupts
PPTX
CISC & RISC Architecture
PPT
Computer Organization and Architecture.
PDF
Von Neumann Architecture
PPTX
Addressing sequencing
PPTX
RISC - Reduced Instruction Set Computing
PPTX
Floating point arithmetic operations (1)
PPTX
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
PPTX
Pci,usb,scsi bus
PPTX
Context free grammar
PPTX
Computer system bus
PPTX
Register Reference Instructions | Computer Science
PPS
Virtual memory
PPTX
Storage class in C Language
PPTX
Memory Hierarchy
PPT
Instruction format
PPTX
Instruction Execution Cycle
PPTX
Operand and Opcode | Computer Science
PPTX
Assembly language programming
Cache memory
Interrupts
CISC & RISC Architecture
Computer Organization and Architecture.
Von Neumann Architecture
Addressing sequencing
RISC - Reduced Instruction Set Computing
Floating point arithmetic operations (1)
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
Pci,usb,scsi bus
Context free grammar
Computer system bus
Register Reference Instructions | Computer Science
Virtual memory
Storage class in C Language
Memory Hierarchy
Instruction format
Instruction Execution Cycle
Operand and Opcode | Computer Science
Assembly language programming
Ad

Viewers also liked (17)

PPT
Assembly Language Lecture 1
PPT
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
PPT
Assembly Language Programming Of 8085
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
DOC
Step to program in tasm
PDF
Unit 2 assembly language programming
PPTX
Single Pass Assembler
PPT
8086 assembly language
PPT
1327 Addressing Modes Of 8086
PPT
Addressing modes
PPTX
Mode of address media
PPT
Assembler
DOCX
MASM -UNIT-III
PPT
Types of instructions
PPTX
ADDRESSING MODE
PPT
Assembly language programming(unit 4)
Assembly Language Lecture 1
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Assembly Language Programming Of 8085
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Step to program in tasm
Unit 2 assembly language programming
Single Pass Assembler
8086 assembly language
1327 Addressing Modes Of 8086
Addressing modes
Mode of address media
Assembler
MASM -UNIT-III
Types of instructions
ADDRESSING MODE
Assembly language programming(unit 4)
Ad

Similar to Assembly Language (20)

PDF
microprocesser-140306112352-phpapp01.pdf
PPT
Assembly language
DOCX
64-bit Assembly language program to Accept and display numbers.docx
PPTX
EC8691-MPMC-PPT.pptx
PPT
Assembly
PPTX
ASSEMBLY LANGUAGE for undergraduate 1.pptx
PPTX
Microprocessor chapter 9 - assembly language programming
PPT
Chapter 2 Part1
PPTX
Computer Organization - Programming the basic computer : Machine Language, As...
PPT
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
PPTX
Programming the basic computer
PPT
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
PPTX
Assembly Language Programming
PPTX
ASSEMBLY LANGUAGE.pptx
PPT
Mca i-u-3-basic computer programming and micro programmed control
PPT
basic computer programming and micro programmed control
PPT
computer architecture and organization.ppt
PDF
Computer organization and assembly language .pdf
PPTX
Introduction to Assembly Language
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 1(Microcomputer ...
microprocesser-140306112352-phpapp01.pdf
Assembly language
64-bit Assembly language program to Accept and display numbers.docx
EC8691-MPMC-PPT.pptx
Assembly
ASSEMBLY LANGUAGE for undergraduate 1.pptx
Microprocessor chapter 9 - assembly language programming
Chapter 2 Part1
Computer Organization - Programming the basic computer : Machine Language, As...
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Programming the basic computer
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
Assembly Language Programming
ASSEMBLY LANGUAGE.pptx
Mca i-u-3-basic computer programming and micro programmed control
basic computer programming and micro programmed control
computer architecture and organization.ppt
Computer organization and assembly language .pdf
Introduction to Assembly Language
Assembly Language Programming By Ytha Yu, Charles Marut Chap 1(Microcomputer ...

Recently uploaded (20)

PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
01-Introduction-to-Information-Management.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Classroom Observation Tools for Teachers
PDF
Pre independence Education in Inndia.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Abdominal Access Techniques with Prof. Dr. R K Mishra
01-Introduction-to-Information-Management.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Cell Types and Its function , kingdom of life
2.FourierTransform-ShortQuestionswithAnswers.pdf
Pharma ospi slides which help in ospi learning
Renaissance Architecture: A Journey from Faith to Humanism
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Supply Chain Operations Speaking Notes -ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Anesthesia in Laparoscopic Surgery in India
102 student loan defaulters named and shamed – Is someone you know on the list?
Classroom Observation Tools for Teachers
Pre independence Education in Inndia.pdf
Institutional Correction lecture only . . .
Week 4 Term 3 Study Techniques revisited.pptx
Final Presentation General Medicine 03-08-2024.pptx

Assembly Language

  • 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
  • 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
  • 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.