SlideShare a Scribd company logo
1 of 56
1
Instruction Set of 8086
An instruction is a binary pattern designed
inside a microprocessor to perform a specific
function.
The entire group of instructions that a
microprocessor supports is called
Instruction Set.
2
Classification of Instruction Set
1. Arithmetic Instructions and Logical Instruction
2. Data Transfer Instructions
3. Branch and Loop Instruction
4. Machine control Instruction
5. Flag Manipulation Instructions
6. Shift and Rotate Instruction
7. String Instructions
21-Nov-2010 3
ohmshankar.ece@act.edu.in
. Data Transfer Instructions
. Data Transfer Instructions
. Data Transfer Instructions
. Data Transfer Instructions
. Data Transfer Instructions
. Data Transfer Instructions
. Data Transfer Instructions
2. Arithmetic And Logical
Instructions
Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
2. Arithmetic And Logical Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3.Bit Manipulation Instructions
3. Branch/Program Execution Transfer
Instructions
 These instructions cause change in the sequence of the
execution of instruction.
 This change can be a conditional or sometimes
unconditional.
 The conditions are represented by flags.
36
Branch Instructions
 JMP Des:
 This instruction is used for unconditional jump from
one place to another.
 Jxx Des (Conditional Jump):
 All the conditional jumps follow some conditional
statements or any instruction that affects the flag.
37
Conditional Jump Table
Mnemonic Meaning Jump Condition
JA Jump if Above CF = 0 and ZF = 0
JAE Jump if Above or Equal CF = 0
JB Jump if Below CF = 1
JBE Jump if Below or Equal CF = 1 or ZF = 1
JC Jump if Carry CF = 1
JE Jump if Equal ZF = 1
JNC Jump if Not Carry CF = 0
JNE Jump if Not Equal ZF = 0
JNZ Jump if Not Zero ZF = 0
JPE Jump if Parity Even PF = 1
38
Loop Instructions
 Loop Des:
 This is a looping instruction.
 The number of times looping is required is placed in the
CX register.
 With each iteration, the contents of CX are
decremented.
 ZF is checked whether to loop again or not.
39
Program Execution Transfer Instructions
 INTO (Interrupt on overflow):
 This instruction generates type 4 interrupt (i.e.
interrupt for overflow) and causes the 8086 to do an
indirect far call a procedure which is written by the
user to handle the overflow condition.
 IRET
 To return the execution to the interrupted program
40
4. Machine Control
Instructions
Machine Control Instructions
HLT (Halt) :- It causes the processor to enter in to the halt
state. It can be stop by INTR,NMI or RESET pin
NOP (No Opration) :- It causes the processor to enter in
to the wait state for 3 Clock cycles.
WAIT :- It causes the processor to enter in to the ideal state.
Can be stop by TEST, INTR OR NMI pin
LOCK :- This instruction prevents other processors to
take the control of shared resources. For e.g LOCK IN
AL,80H
21-Nov-2010 42
ohmshankar.ece@act.edu.in
5. Flag Manipulation
Instructions
 STC:
 It sets the carry flag to 1.
 CLC:
 It clears the carry flag to 0.
 CMC:
 It complements the carry flag.
44
Flag Manipulation Instructions
 STD:
 It sets the direction flag to 1.
 If it is set, string bytes are accessed from higher memory
address to lower memory address.
 CLD:
 It clears the direction flag to 0.
 If it is reset, the string bytes are accessed from lower
memory address to higher memory address.
45
Flag Manipulation Instructions
 STI:
 It sets the Interrupt flag to 1.
 CLI:
 It clears the Interrupt flag to 0.
21-Nov-2010 46
ohmshankar.ece@act.edu.in
Flag Manipulation Instructions
7. String Manipulation
Instructions
String Manipulation
Instructions
 String in assembly language is just a sequentially
stored bytes or words.
 There are very strong set of string instructions in 8086.
 By using these string instructions, the size of the
program is considerably reduced.
48
String Manipulation Instructions
49
8086 Microprocessor
 String : Sequence of bytes or words
 8086 instruction set includes instruction for string movement, comparison, scan, load and
store.
 REP instruction prefix : used to repeat execution of string instructions
 String instructions end with S or SB or SW. S represents string, SB string byte and
SW string word.
 Offset or effective address of the source operand is stored in SI register and that of the
destination operand is stored in DI register.
 Depending on the status of DF, SI and DI registers are automatically updated.
 DF = 0  SI and DI are incremented by 1 for byte and 2 for word.
 DF = 1  SI and DI are decremented by 1 for byte and 2 for word.
String Manipulation
Instructions
 MOVS / MOVSB / MOVSW:
 It causes moving of byte or word from one string to
another.
 In this instruction, the source string is in Data Segment
referred by DS:SI and destination string is in Extra
Segment referred by ES:DI.
 For e.g. movs str1,str2
 Movsb
 Movsw
50
String Manipulation
Instructions
 LODS / LODSB / LODSW:
 It causes TRANSFER of byte or word from one string to
another.
 In this instruction, the source string is in Data Segment
referred by DS:SI transferred to Accumulator.
 For e.g. lods string
 lodsb
 lodsw
51
String Manipulation
Instructions
 STOS / STOSB / STOSW:
It causes TRANSFER of byte or word from one string to
another.
In this instruction, the string is in Extra Segment referred by
ES:DI transferred to Accumulator.
 For e.g. stos string
 stosb
 stosw
52
String Manipulation
Instructions
 CMPS Des, Src:
 It compares the string bytes or words.
 SCAS String:
 It scans a string.
 It compares the String with byte in AL or with word in
AX.
21-Nov-2010 53
ohmshankar.ece@act.edu.in
String Manipulation
Instructions
 REP (Repeat):
 This is an instruction prefix.
 It causes the repetition of the instruction until CX
becomes zero.
 E.g.: REP MOVSB
 It copies byte by byte contents.
 REP repeats the operation MOVSB until CX becomes zero.
21-Nov-2010 54
ohmshankar.ece@act.edu.in
55
8086 Microprocessor
REP
REPZ/ REPE
(Repeat CMPS or SCAS
until ZF = 0)
REPNZ/ REPNE
(Repeat CMPS or SCAS
until ZF = 1)
While CX  0 and ZF = 1, repeat execution of
string instruction and
(CX)  (CX) – 1
While CX  0 and ZF = 0, repeat execution of
string instruction and
(CX)  (CX) - 1
String Manipulation
Instructions
56

More Related Content

Similar to 8086-instruction sets.ppt

Vlsiexpt 11 12
Vlsiexpt 11 12Vlsiexpt 11 12
Vlsiexpt 11 12
JINCY Soju
 

Similar to 8086-instruction sets.ppt (20)

Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language
 
Assembly language.pptx
Assembly language.pptxAssembly language.pptx
Assembly language.pptx
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
viva q&a for mp lab
viva q&a for mp labviva q&a for mp lab
viva q&a for mp lab
 
Bc0040
Bc0040Bc0040
Bc0040
 
8.pptx
8.pptx8.pptx
8.pptx
 
Assembly language
Assembly languageAssembly language
Assembly language
 
X86 operation types
X86 operation typesX86 operation types
X86 operation types
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
MES_MODULE 2.pptx
MES_MODULE 2.pptxMES_MODULE 2.pptx
MES_MODULE 2.pptx
 
Microprocessors-based systems (under graduate course) Lecture 7 of 9
Microprocessors-based systems (under graduate course) Lecture 7 of 9 Microprocessors-based systems (under graduate course) Lecture 7 of 9
Microprocessors-based systems (under graduate course) Lecture 7 of 9
 
Chapter#16
Chapter#16Chapter#16
Chapter#16
 
Vlsiexpt 11 12
Vlsiexpt 11 12Vlsiexpt 11 12
Vlsiexpt 11 12
 
Microprocessors-based systems (under graduate course) Lecture 6 of 9
Microprocessors-based systems (under graduate course) Lecture 6 of 9 Microprocessors-based systems (under graduate course) Lecture 6 of 9
Microprocessors-based systems (under graduate course) Lecture 6 of 9
 
microcontroller_instruction_set for ENGINEERING STUDENTS
microcontroller_instruction_set for  ENGINEERING STUDENTSmicrocontroller_instruction_set for  ENGINEERING STUDENTS
microcontroller_instruction_set for ENGINEERING STUDENTS
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9 Microprocessors-based systems (under graduate course) Lecture 4 of 9
Microprocessors-based systems (under graduate course) Lecture 4 of 9
 
Micro Processor And Micro controller
Micro Processor And Micro controller Micro Processor And Micro controller
Micro Processor And Micro controller
 
Programming with 8085.pptx
Programming with 8085.pptxProgramming with 8085.pptx
Programming with 8085.pptx
 
VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015
VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015
VTU 4TH SEM CSE MICROPROCESSORS SOLVED PAPERS OF JUNE-2014 & JUNE-2015
 

Recently uploaded

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
heathfieldcps1
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
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
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
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
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
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
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 

8086-instruction sets.ppt

  • 1. 1
  • 2. Instruction Set of 8086 An instruction is a binary pattern designed inside a microprocessor to perform a specific function. The entire group of instructions that a microprocessor supports is called Instruction Set. 2
  • 3. Classification of Instruction Set 1. Arithmetic Instructions and Logical Instruction 2. Data Transfer Instructions 3. Branch and Loop Instruction 4. Machine control Instruction 5. Flag Manipulation Instructions 6. Shift and Rotate Instruction 7. String Instructions 21-Nov-2010 3 ohmshankar.ece@act.edu.in
  • 4. . Data Transfer Instructions
  • 5. . Data Transfer Instructions
  • 6. . Data Transfer Instructions
  • 7. . Data Transfer Instructions
  • 8. . Data Transfer Instructions
  • 9. . Data Transfer Instructions
  • 10. . Data Transfer Instructions
  • 11. 2. Arithmetic And Logical Instructions
  • 12. Arithmetic And Logical Instructions
  • 13. 2. Arithmetic And Logical Instructions
  • 14. 2. Arithmetic And Logical Instructions
  • 15. 2. Arithmetic And Logical Instructions
  • 16. 2. Arithmetic And Logical Instructions
  • 17. 2. Arithmetic And Logical Instructions
  • 18. 2. Arithmetic And Logical Instructions
  • 19. 2. Arithmetic And Logical Instructions
  • 20. 2. Arithmetic And Logical Instructions
  • 21. 2. Arithmetic And Logical Instructions
  • 22. 2. Arithmetic And Logical Instructions
  • 35.
  • 36. 3. Branch/Program Execution Transfer Instructions  These instructions cause change in the sequence of the execution of instruction.  This change can be a conditional or sometimes unconditional.  The conditions are represented by flags. 36
  • 37. Branch Instructions  JMP Des:  This instruction is used for unconditional jump from one place to another.  Jxx Des (Conditional Jump):  All the conditional jumps follow some conditional statements or any instruction that affects the flag. 37
  • 38. Conditional Jump Table Mnemonic Meaning Jump Condition JA Jump if Above CF = 0 and ZF = 0 JAE Jump if Above or Equal CF = 0 JB Jump if Below CF = 1 JBE Jump if Below or Equal CF = 1 or ZF = 1 JC Jump if Carry CF = 1 JE Jump if Equal ZF = 1 JNC Jump if Not Carry CF = 0 JNE Jump if Not Equal ZF = 0 JNZ Jump if Not Zero ZF = 0 JPE Jump if Parity Even PF = 1 38
  • 39. Loop Instructions  Loop Des:  This is a looping instruction.  The number of times looping is required is placed in the CX register.  With each iteration, the contents of CX are decremented.  ZF is checked whether to loop again or not. 39
  • 40. Program Execution Transfer Instructions  INTO (Interrupt on overflow):  This instruction generates type 4 interrupt (i.e. interrupt for overflow) and causes the 8086 to do an indirect far call a procedure which is written by the user to handle the overflow condition.  IRET  To return the execution to the interrupted program 40
  • 42. Machine Control Instructions HLT (Halt) :- It causes the processor to enter in to the halt state. It can be stop by INTR,NMI or RESET pin NOP (No Opration) :- It causes the processor to enter in to the wait state for 3 Clock cycles. WAIT :- It causes the processor to enter in to the ideal state. Can be stop by TEST, INTR OR NMI pin LOCK :- This instruction prevents other processors to take the control of shared resources. For e.g LOCK IN AL,80H 21-Nov-2010 42 ohmshankar.ece@act.edu.in
  • 44.  STC:  It sets the carry flag to 1.  CLC:  It clears the carry flag to 0.  CMC:  It complements the carry flag. 44 Flag Manipulation Instructions
  • 45.  STD:  It sets the direction flag to 1.  If it is set, string bytes are accessed from higher memory address to lower memory address.  CLD:  It clears the direction flag to 0.  If it is reset, the string bytes are accessed from lower memory address to higher memory address. 45 Flag Manipulation Instructions
  • 46.  STI:  It sets the Interrupt flag to 1.  CLI:  It clears the Interrupt flag to 0. 21-Nov-2010 46 ohmshankar.ece@act.edu.in Flag Manipulation Instructions
  • 48. String Manipulation Instructions  String in assembly language is just a sequentially stored bytes or words.  There are very strong set of string instructions in 8086.  By using these string instructions, the size of the program is considerably reduced. 48
  • 49. String Manipulation Instructions 49 8086 Microprocessor  String : Sequence of bytes or words  8086 instruction set includes instruction for string movement, comparison, scan, load and store.  REP instruction prefix : used to repeat execution of string instructions  String instructions end with S or SB or SW. S represents string, SB string byte and SW string word.  Offset or effective address of the source operand is stored in SI register and that of the destination operand is stored in DI register.  Depending on the status of DF, SI and DI registers are automatically updated.  DF = 0  SI and DI are incremented by 1 for byte and 2 for word.  DF = 1  SI and DI are decremented by 1 for byte and 2 for word.
  • 50. String Manipulation Instructions  MOVS / MOVSB / MOVSW:  It causes moving of byte or word from one string to another.  In this instruction, the source string is in Data Segment referred by DS:SI and destination string is in Extra Segment referred by ES:DI.  For e.g. movs str1,str2  Movsb  Movsw 50
  • 51. String Manipulation Instructions  LODS / LODSB / LODSW:  It causes TRANSFER of byte or word from one string to another.  In this instruction, the source string is in Data Segment referred by DS:SI transferred to Accumulator.  For e.g. lods string  lodsb  lodsw 51
  • 52. String Manipulation Instructions  STOS / STOSB / STOSW: It causes TRANSFER of byte or word from one string to another. In this instruction, the string is in Extra Segment referred by ES:DI transferred to Accumulator.  For e.g. stos string  stosb  stosw 52
  • 53. String Manipulation Instructions  CMPS Des, Src:  It compares the string bytes or words.  SCAS String:  It scans a string.  It compares the String with byte in AL or with word in AX. 21-Nov-2010 53 ohmshankar.ece@act.edu.in
  • 54. String Manipulation Instructions  REP (Repeat):  This is an instruction prefix.  It causes the repetition of the instruction until CX becomes zero.  E.g.: REP MOVSB  It copies byte by byte contents.  REP repeats the operation MOVSB until CX becomes zero. 21-Nov-2010 54 ohmshankar.ece@act.edu.in
  • 55. 55 8086 Microprocessor REP REPZ/ REPE (Repeat CMPS or SCAS until ZF = 0) REPNZ/ REPNE (Repeat CMPS or SCAS until ZF = 1) While CX  0 and ZF = 1, repeat execution of string instruction and (CX)  (CX) – 1 While CX  0 and ZF = 0, repeat execution of string instruction and (CX)  (CX) - 1 String Manipulation Instructions
  • 56. 56