SlideShare ist ein Scribd-Unternehmen logo
1 von 6
MICROPROCESSOR 8085
LECTURE 10
INSTRUCTION SET-IV
PROF. SANDIP DAS
INSTRUCTION CLASSIFICATION
• Data Transfer group
• Arithmetic group
• Logical group
• Branch group
• Stack, I/O and Machine Control group
WRITE A PROGRAM TO SUBTRACT TWO 8 BIT
NUMBERS
Memory address Mnemonics, operands Comments
2000 LXI H,2501H Get address of 1st number in
H-L pair
2003 MOV A,M 1st number in accumulator
2004 INX H Content of H-L pair increases
from 2501H to 2502H
2005 SUB M 1st num-2nd num
2006 INX H Content of H-L pair becomes
2503H
2007 MOV M,A Store result in 2503H
2008 HLT Halt
Example-1 Example-2
2501-49H 2501-F8H
2502-32H 2502-9BH
Result is stored in the memory location 2503H
2503-17H 2503-5DH
Note: If the second
number is greater than
the first number, the
processor will give result
in 2’s complement, i.e.,
negative result.
BRANCH
GROUP
Categorized into two types: Conditional and Unconditional
Conditional branch instructions transfer the program to the specified address when certain condition is
satisfied.
Unconditional branch instructions transfer the program to the specified address unconditionally.
Unconditional Jump Instruction
JMP addr(label) jump to the instruction specified by the address T-states: 10 Flags:
none M-cycle-3
Byte 2nd and byte 3rd of the instruction give the address of the label (memory location)
where the program
jumps for next instruction to be executed.
JZ addr (label) Jump if result is zero T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if result is zero.
JNZ addr (label) Jump if result is not zero T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if result is not zero.
JC addr (label) Jump if there is carry T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if there is carry (i.e., CS=1)
JNC addr (label) Jump if there is no carry T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if there is no carry (i.e.,
CS=0)
JP addr (label) Jump if the result is plus T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if the result is plus.
JM addr (label) Jump if the result is minus T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if the result is minus.
JPE addr (label) Jump if even parity T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if even parity (i.e., P=1).
JPO addr (label) Jump if odd parity T-states: 7/10 Flags affected: none M-cycle-2/3
The program jumps to the instruction specified by the address (label) if odd parity (i.e., P=0).
BRANCH
GROUP
WRITE A PROGRAM TO ADD TWO 8 BIT NUMBERS
WHOSE RESULT WILL BE 16 BIT
Memory address Labels Mnemonics, operands Comments
2000 LXI H,2501H Get address of 1st number in H-L pair
2003 MVI C,00 MSBs of sum in register C,
Initial value=00
2005 MOV A,M 1st number in accumulator
2006 INX H Content of H-L pair increases from
2501H to 2502H
2007 ADD M 1st num+2nd num
2008 JNC AHEAD Is Carry? No, go to the label AHEAD
200B INR C Yes, increment C.
200C AHEAD STA 2503H Store LSBs of result in 2503H
200F MOV A,C Store MSBs of result in
accumulator
2010 STA 2504H Store MSBs of result in 2504H
2013 HLT
Example-1
2501-98H 2502-9AH
Result is stored in the memory location 2503H & 2504H
2503-32H, 2504-01H

Weitere ähnliche Inhalte

Was ist angesagt?

Code generator
Code generatorCode generator
Code generator
Tech_MX
 
How to work on Matlab.......
How to work on Matlab.......How to work on Matlab.......
How to work on Matlab.......
biinoida
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
Ahammed Alamin
 

Was ist angesagt? (19)

Control Flow Graphs
Control Flow GraphsControl Flow Graphs
Control Flow Graphs
 
MATLAB Basics-Part1
MATLAB Basics-Part1MATLAB Basics-Part1
MATLAB Basics-Part1
 
Code generator
Code generatorCode generator
Code generator
 
17431 microprocessor & programming
17431  microprocessor & programming17431  microprocessor & programming
17431 microprocessor & programming
 
Signal Flow Graph Introduction
Signal Flow Graph IntroductionSignal Flow Graph Introduction
Signal Flow Graph Introduction
 
How to work on Matlab.......
How to work on Matlab.......How to work on Matlab.......
How to work on Matlab.......
 
Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
 
Compiler worksheet
Compiler worksheetCompiler worksheet
Compiler worksheet
 
Compiler unit 5
Compiler  unit 5Compiler  unit 5
Compiler unit 5
 
MatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On PlottingMatLab Basic Tutorial On Plotting
MatLab Basic Tutorial On Plotting
 
9781285852744 ppt ch18
9781285852744 ppt ch189781285852744 ppt ch18
9781285852744 ppt ch18
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
C basics
C basicsC basics
C basics
 
Basic blocks - compiler design
Basic blocks - compiler designBasic blocks - compiler design
Basic blocks - compiler design
 
Cs8251 faq1
Cs8251 faq1Cs8251 faq1
Cs8251 faq1
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Assignment
AssignmentAssignment
Assignment
 
Matlab
MatlabMatlab
Matlab
 
Code generation in Compiler Design
Code generation in Compiler DesignCode generation in Compiler Design
Code generation in Compiler Design
 

Ähnlich wie 7. 8085 instruction set iv

Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
vijaydeepakg
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
Dr P Deepak
 

Ähnlich wie 7. 8085 instruction set iv (20)

9. 8085 instruction set v
9. 8085 instruction set v9. 8085 instruction set v
9. 8085 instruction set v
 
4. 8085 instruction set i
4. 8085 instruction set i4. 8085 instruction set i
4. 8085 instruction set i
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
Basic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and FlowchartsBasic Slides on Algorithms and Flowcharts
Basic Slides on Algorithms and Flowcharts
 
Basic programming of 8085
Basic programming of 8085 Basic programming of 8085
Basic programming of 8085
 
AlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdfAlgorithmAndFlowChart.pdf
AlgorithmAndFlowChart.pdf
 
12 mt06ped008
12 mt06ped008 12 mt06ped008
12 mt06ped008
 
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.pptLecture1-Algorithms-and-Flowcharts-ppt.ppt
Lecture1-Algorithms-and-Flowcharts-ppt.ppt
 
Malp edusat
Malp edusatMalp edusat
Malp edusat
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
8. 8085 programming example
8. 8085 programming example8. 8085 programming example
8. 8085 programming example
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
 
5. 8085 instruction set ii
5. 8085 instruction set ii5. 8085 instruction set ii
5. 8085 instruction set ii
 
basic computer programming and micro programmed control
basic computer programming and micro programmed controlbasic computer programming and micro programmed control
basic computer programming and micro programmed control
 
Mca i-u-3-basic computer programming and micro programmed control
Mca i-u-3-basic computer programming and micro programmed controlMca i-u-3-basic computer programming and micro programmed control
Mca i-u-3-basic computer programming and micro programmed control
 
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed controlBca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
 
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed controlB.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
 

Mehr von sandip das

Mehr von sandip das (20)

31. 8086 addressing modes
31. 8086 addressing modes31. 8086 addressing modes
31. 8086 addressing modes
 
30. 8086 microprocessor pipelined architecture
30. 8086 microprocessor pipelined architecture30. 8086 microprocessor pipelined architecture
30. 8086 microprocessor pipelined architecture
 
29. 8086 microprocessor pin diagram
29. 8086 microprocessor pin diagram29. 8086 microprocessor pin diagram
29. 8086 microprocessor pin diagram
 
28. 8251 programmable communication interface
28. 8251 programmable communication interface28. 8251 programmable communication interface
28. 8251 programmable communication interface
 
27. 8259 programmable interrupt controller
27. 8259 programmable interrupt controller27. 8259 programmable interrupt controller
27. 8259 programmable interrupt controller
 
26. 8255 control word programming
26. 8255 control word programming26. 8255 control word programming
26. 8255 control word programming
 
25. 8255 programmable peripheral interface
25. 8255 programmable peripheral interface25. 8255 programmable peripheral interface
25. 8255 programmable peripheral interface
 
24. direct memory access
24. direct memory access24. direct memory access
24. direct memory access
 
23. serial and parallel data communication
23. serial and parallel data communication23. serial and parallel data communication
23. serial and parallel data communication
 
22. interrupts ii
22. interrupts ii22. interrupts ii
22. interrupts ii
 
21. interrupts
21. interrupts21. interrupts
21. interrupts
 
20. io interfacing ii
20. io interfacing ii20. io interfacing ii
20. io interfacing ii
 
19. io interfacing i
19. io interfacing i19. io interfacing i
19. io interfacing i
 
18. memory interfacing iv
18. memory interfacing iv18. memory interfacing iv
18. memory interfacing iv
 
17. memory interfacing iii
17. memory interfacing iii17. memory interfacing iii
17. memory interfacing iii
 
16. memory interfacing ii
16. memory interfacing ii16. memory interfacing ii
16. memory interfacing ii
 
15. memory interfacing i
15. memory interfacing i15. memory interfacing i
15. memory interfacing i
 
14. 8085 programming example vi
14. 8085 programming example vi14. 8085 programming example vi
14. 8085 programming example vi
 
13. 8085 programming example v
13. 8085 programming example v13. 8085 programming example v
13. 8085 programming example v
 
12. 8085 programming example iv
12. 8085 programming example iv12. 8085 programming example iv
12. 8085 programming example iv
 

Kürzlich hochgeladen

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 

Kürzlich hochgeladen (20)

The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 

7. 8085 instruction set iv

  • 2. INSTRUCTION CLASSIFICATION • Data Transfer group • Arithmetic group • Logical group • Branch group • Stack, I/O and Machine Control group
  • 3. WRITE A PROGRAM TO SUBTRACT TWO 8 BIT NUMBERS Memory address Mnemonics, operands Comments 2000 LXI H,2501H Get address of 1st number in H-L pair 2003 MOV A,M 1st number in accumulator 2004 INX H Content of H-L pair increases from 2501H to 2502H 2005 SUB M 1st num-2nd num 2006 INX H Content of H-L pair becomes 2503H 2007 MOV M,A Store result in 2503H 2008 HLT Halt Example-1 Example-2 2501-49H 2501-F8H 2502-32H 2502-9BH Result is stored in the memory location 2503H 2503-17H 2503-5DH Note: If the second number is greater than the first number, the processor will give result in 2’s complement, i.e., negative result.
  • 4. BRANCH GROUP Categorized into two types: Conditional and Unconditional Conditional branch instructions transfer the program to the specified address when certain condition is satisfied. Unconditional branch instructions transfer the program to the specified address unconditionally. Unconditional Jump Instruction JMP addr(label) jump to the instruction specified by the address T-states: 10 Flags: none M-cycle-3 Byte 2nd and byte 3rd of the instruction give the address of the label (memory location) where the program jumps for next instruction to be executed.
  • 5. JZ addr (label) Jump if result is zero T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if result is zero. JNZ addr (label) Jump if result is not zero T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if result is not zero. JC addr (label) Jump if there is carry T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if there is carry (i.e., CS=1) JNC addr (label) Jump if there is no carry T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if there is no carry (i.e., CS=0) JP addr (label) Jump if the result is plus T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if the result is plus. JM addr (label) Jump if the result is minus T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if the result is minus. JPE addr (label) Jump if even parity T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if even parity (i.e., P=1). JPO addr (label) Jump if odd parity T-states: 7/10 Flags affected: none M-cycle-2/3 The program jumps to the instruction specified by the address (label) if odd parity (i.e., P=0). BRANCH GROUP
  • 6. WRITE A PROGRAM TO ADD TWO 8 BIT NUMBERS WHOSE RESULT WILL BE 16 BIT Memory address Labels Mnemonics, operands Comments 2000 LXI H,2501H Get address of 1st number in H-L pair 2003 MVI C,00 MSBs of sum in register C, Initial value=00 2005 MOV A,M 1st number in accumulator 2006 INX H Content of H-L pair increases from 2501H to 2502H 2007 ADD M 1st num+2nd num 2008 JNC AHEAD Is Carry? No, go to the label AHEAD 200B INR C Yes, increment C. 200C AHEAD STA 2503H Store LSBs of result in 2503H 200F MOV A,C Store MSBs of result in accumulator 2010 STA 2504H Store MSBs of result in 2504H 2013 HLT Example-1 2501-98H 2502-9AH Result is stored in the memory location 2503H & 2504H 2503-32H, 2504-01H