SlideShare une entreprise Scribd logo
1  sur  6
MICROPROCESSOR 8085
LECTURE 11
PROGRAMMING EXAMPLE
PROF. SANDIP DAS
WRITE A PROGRAM TO FIND ONE’S COMPLEMENT OF AN
8-BIT NUMBER
Memory address Labels Mnemonics, operands Comments
2000 LDA 2501H Get data in accumulator
2003 CMA Take its complement
2004 STA 2502H Store result in 2502H
2007 HLT Halt
Example-1
2501-96H
Result is stored in the memory location 2502H
2502-69H
WRITE A PROGRAM TO FIND TWO’S COMPLEMENT OF
AN 8-BIT NUMBER
Memory address Labels Mnemonics, operands Comments
2000 LDA 2501H Get data in accumulator
2003 CMA Take its complement
2004 ADI 01 Take 2’s complement
2005 STA 2502H Store result in 2502H
2008 HLT Halt
Example-1
2501-96H
Result is stored in the memory location 2502H
2502-6AH
WRITE A PROGRAM TO FIND SMALLER OF TWO NUMBERS
Memory address Labels Mnemonics, operands Comments
2000 LXI H,2501H Address of 1st number I H-L pair
2003 MOV A,M 1st number in accumulator
2004 INX H Address of 2nd number I H-L pair
2005 CMP M Compare 2nd number with 1st
number
Is 1st number<2nd number?
2006 JC AHEAD Yes, smaller number is in
accumulator.
Go to AHEAD.
2009 MOV A,M No, get 2nd number in accumulator.
200A AHEAD STA 2503H Store smaller number in 2503H
200D HLT HaltNOTE: when A>M then CS=0,
Z=0
when M>A then CS=1,
Z=0
when A=M then CS=0,
Z=1
WRITE A PROGRAM TO FIND THE NUMBER IN A ARRAY
Memory address Labels Mnemonics, operands Comments
2000 LXI H,2500H Address of count in H-L pair
2003 MOV C,M Count in C register
2004 INX H Address of 1st number in H-L pair
2005 MOV A,M 1st number in accumulator
2006 DCR C Decrement count.
2007 LOOP INX H Address of 2nd number in H-L pair.
2008 CMP M Compare 2nd number with 1st number
Is 2nd number>1st number?
2009 JNC AHEAD No, larger number is in accumulator.
Go to AHEAD
200C MOV A,M Yes, get larger number in
accumulator
200D AHEAD DCR C Decrement count.
200E JNZ LOOP
2011 STA 2504H Store result in 2504H
2014 HLT Halt
Data:
2500-
03
2501-
98
2502-
75
Result:
2504-
99
ASSIGNMENT-3
• Write a program to find 2’s complement of 16bit number
• Write a program to find decimal addition of two 8bit number,
result will be 16 bit.
• Write a program to add two 16 bit numbers, result will be 16bit
or more.

Contenu connexe

Similaire à 8. 8085 programming example

Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 
3. 8085 addressing modes
3. 8085 addressing modes3. 8085 addressing modes
3. 8085 addressing modessandip das
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction setJLoknathDora
 
7. 8085 instruction set iv
7. 8085 instruction set iv7. 8085 instruction set iv
7. 8085 instruction set ivsandip das
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingAmitabh Shukla
 
8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdf8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdfFloraKara
 
Microprocessor Part 3
Microprocessor    Part  3Microprocessor    Part  3
Microprocessor Part 3Sajan Agrawal
 
03 addr mode &amp; instructions
03 addr mode &amp; instructions03 addr mode &amp; instructions
03 addr mode &amp; instructionsShubhamBakshi14
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualAnkit Kumar
 
8085 Assembly language programs.pdf
8085 Assembly language programs.pdf8085 Assembly language programs.pdf
8085 Assembly language programs.pdfRahulMishra122561
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdfHimanshuPant41
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Swati Watve-Phadke
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSSwapnil Mishra
 

Similaire à 8. 8085 programming example (20)

Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
3. 8085 addressing modes
3. 8085 addressing modes3. 8085 addressing modes
3. 8085 addressing modes
 
8085_Excercise.pptx
8085_Excercise.pptx8085_Excercise.pptx
8085_Excercise.pptx
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
7. 8085 instruction set iv
7. 8085 instruction set iv7. 8085 instruction set iv
7. 8085 instruction set iv
 
Programming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacingProgramming with 8085-Microprocessor and interfacing
Programming with 8085-Microprocessor and interfacing
 
8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdf8085_MicroelectronicAndMicroprocess.pdf
8085_MicroelectronicAndMicroprocess.pdf
 
1.pdf
1.pdf1.pdf
1.pdf
 
Microprocessor Part 3
Microprocessor    Part  3Microprocessor    Part  3
Microprocessor Part 3
 
03 addr mode &amp; instructions
03 addr mode &amp; instructions03 addr mode &amp; instructions
03 addr mode &amp; instructions
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
microprocessor Laboratory experiments manual
microprocessor Laboratory experiments manualmicroprocessor Laboratory experiments manual
microprocessor Laboratory experiments manual
 
8085 Assembly language programs.pdf
8085 Assembly language programs.pdf8085 Assembly language programs.pdf
8085 Assembly language programs.pdf
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
Av222 lab 1 st part
Av222 lab 1 st partAv222 lab 1 st part
Av222 lab 1 st part
 
Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02Assemblylanguageprogrammingof8085 100523023329-phpapp02
Assemblylanguageprogrammingof8085 100523023329-phpapp02
 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
 

Plus de sandip das

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

Plus de 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
 

Dernier

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
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...ranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
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 Bookingdharasingh5698
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
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.pptxfenichawla
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
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
 

Dernier (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
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...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
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
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
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
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
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...
 

8. 8085 programming example

  • 2. WRITE A PROGRAM TO FIND ONE’S COMPLEMENT OF AN 8-BIT NUMBER Memory address Labels Mnemonics, operands Comments 2000 LDA 2501H Get data in accumulator 2003 CMA Take its complement 2004 STA 2502H Store result in 2502H 2007 HLT Halt Example-1 2501-96H Result is stored in the memory location 2502H 2502-69H
  • 3. WRITE A PROGRAM TO FIND TWO’S COMPLEMENT OF AN 8-BIT NUMBER Memory address Labels Mnemonics, operands Comments 2000 LDA 2501H Get data in accumulator 2003 CMA Take its complement 2004 ADI 01 Take 2’s complement 2005 STA 2502H Store result in 2502H 2008 HLT Halt Example-1 2501-96H Result is stored in the memory location 2502H 2502-6AH
  • 4. WRITE A PROGRAM TO FIND SMALLER OF TWO NUMBERS Memory address Labels Mnemonics, operands Comments 2000 LXI H,2501H Address of 1st number I H-L pair 2003 MOV A,M 1st number in accumulator 2004 INX H Address of 2nd number I H-L pair 2005 CMP M Compare 2nd number with 1st number Is 1st number<2nd number? 2006 JC AHEAD Yes, smaller number is in accumulator. Go to AHEAD. 2009 MOV A,M No, get 2nd number in accumulator. 200A AHEAD STA 2503H Store smaller number in 2503H 200D HLT HaltNOTE: when A>M then CS=0, Z=0 when M>A then CS=1, Z=0 when A=M then CS=0, Z=1
  • 5. WRITE A PROGRAM TO FIND THE NUMBER IN A ARRAY Memory address Labels Mnemonics, operands Comments 2000 LXI H,2500H Address of count in H-L pair 2003 MOV C,M Count in C register 2004 INX H Address of 1st number in H-L pair 2005 MOV A,M 1st number in accumulator 2006 DCR C Decrement count. 2007 LOOP INX H Address of 2nd number in H-L pair. 2008 CMP M Compare 2nd number with 1st number Is 2nd number>1st number? 2009 JNC AHEAD No, larger number is in accumulator. Go to AHEAD 200C MOV A,M Yes, get larger number in accumulator 200D AHEAD DCR C Decrement count. 200E JNZ LOOP 2011 STA 2504H Store result in 2504H 2014 HLT Halt Data: 2500- 03 2501- 98 2502- 75 Result: 2504- 99
  • 6. ASSIGNMENT-3 • Write a program to find 2’s complement of 16bit number • Write a program to find decimal addition of two 8bit number, result will be 16 bit. • Write a program to add two 16 bit numbers, result will be 16bit or more.