SlideShare a Scribd company logo
Write a program to transfer 09 bytes of data from external RAM
address location 9000H to internal RAM address
location 50H.
MOV DPTR, #9000H
MOV R0, #50H
MOV R2, #09H
MOVX A, @DPTR
MOV @R0, A
INC DPTR
INC R0
DJNZ R2, L1
HERE: S J M P HERE
Write a program to add list of 10 no.s stored from the internal RAM
address location 60H. Store the result in the memory location 80H.
MOV R0, #60H
MOV R1, #80H
MOV R2, #0AH MOVX A, #00H MOV R3,#00H
L2: ADD A, @R0 JNC L1
INC R3
L1: INC R0
DJNZ R2, L2
MOV @R1, A
INC R1
MOV A, @R3
MOV @R1, A
HERE: S J MP HERE
Write a program to exchange 10 bytes from 50H to 60H.
MOV R0, #50H
MOV R1, #60H
MOV R2, #0AH
L1: MOV A, @R0
XCH A, @R0
MOV @R0, A
INC R0
INC R1
DJNZ R2, L1
HERE: SJMP HERE
Write a program to move 10 bytes of data from internal ROM
0500H to Internal RAM 50H.
MOV DPTR, #0500H
MOV R0, # 50H
MOV R2, #0AH
L1: MOVX A, @DPTR
MOV @R0, A
INC DPTR
INC R0
DJNZ R2, L1
HERE: SJMP HERE
Develop an Assembly Language Program to find whether a given
byte is available in the given sequence or not. If it is available,
write FF in R3, otherwise write 00 in R3.
MOV R0, #20H
MOV R3, #00H
MOV R1, #05H
BAC K MOV A, @R0
CJNE A, #45H, AHEAD
MOV R3, #0FFH
INC R0
DJNZ R1, BACK
AHEAD
HERE S J MP HERE
Develop an assembly language program to
find average of two eight bit numbers
MOV F0 (B), #02H
MOV A,R0
ADD A,R1
DIV AB MOV
R2, A SJMP
HERE
HERE:
Develop an assembly language program to count the number of 1s and 0s in
given byte of data.
MOV A, #25H
MOV R0, #80H
MOV R1, #00H
MOV R2, #00H
MOV R3, #08H
CLR C
UP: RRC A
JNC DOWN
INC R1
SJMP NEXT
DOWN: INC R2
NEXT: DJNZ R3, UP
MOV A, R1
MOV @R0, A
INC R0
MOV A, R2
MOV @R0, A
HERE: SJMP HERE
Develop a program by using 8051 instructions to multiply two 8-
bit numbers present at memory locations 9000H and 9001H and
store the result at the memory locations 9050H and 9051H.
MOV DPTR, #9000
MOVX A, @DPTR
MOV 0F0, A
MOV DPTR, #9001
MOVX A, @DPTR
MUL AB
MOV DPTR, #9050
MOVX @DPTR, A INC
DPTR
MOV A, 0F0H MOVX
@DPTR, A
SJMP HERE
HERE:
Develop a program by using 8051 instructions to divide an 8- bit
number present at memory location 8000H with number present at
address 8001H and store the quotient at the memory location 8020
and remainder at memory address 8021H.
MOV
MOVX
MOV
INC
MOVX
MOV
MOV
DIV
MOV
MOVX
INC
MOV
MOVX
SJMP
DPTR, #8000H
A, @DPTR
R0, A
DPTR
A, @DPTR 0F0,
A
A, R0 AB
DPTR, #8020H
@DPTR, A DPTR
A, 0F0H
@DPTR, A HERE
HERE:
Develop an assembly language program to find Odd & Even numbers
from the given series of numbers.
MOV R0, #80H
MOV R1, #00H
MOV R2, #00H
MOV R3, #10H
MOV A, @R0
CLR C
RRC A
JNC DOWN
INC R1
SJMP NEXT
INC R2
INC R0
DJNZ R3, UP
MOV A, R1
MOV @R0, A
INC R0
MOV A, R2
MOV @R0, A
SJMP HERE
UP:
DOWN:
NEXT:
HERE:
Develop an assembly language program to find Positive & Negative numbers from the
given series of numbers.
MOV R0, #90H
MOV R1, #00H
MOV R2, #00H
MOV R3, #10H
MOV A, @R0
CLR C
RLC A
JNC DOWN
INC R1
SJMP NEXT
INC R2
INC R0
DJNZ R3, UP
MOV A, R1
MOV @R0, A
INC R0
MOV A, R2
MOV @R0, A
UP:
DOWN:
NEXT:
HERE: SJMP HERE

More Related Content

Similar to Programs using Microcontrollers.ppt

Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent vijaydeepakg
 
1347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 80511347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 8051techbed
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 softbaluusa8
 
Microprocessor system - summarize
Microprocessor system - summarizeMicroprocessor system - summarize
Microprocessor system - summarizeHisham Mat Hussin
 
432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdfShreeKrishnaTarai
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollerjokersclown57
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modesVima Mali
 
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp011347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01bvenkanna
 
MICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxMICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxAmoghR3
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentationJiMs ChAcko
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051) vijaydeepakg
 
Assembly Language
Assembly LanguageAssembly Language
Assembly LanguageAMIT GODRE
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :PJathin Kanumuri
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2Jathin Kanumuri
 
Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine Arkhom Jodtang
 

Similar to Programs using Microcontrollers.ppt (20)

Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent
 
1347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 80511347 Assembly Language Programming Of 8051
1347 Assembly Language Programming Of 8051
 
Microcontroller 8051 soft
Microcontroller 8051  softMicrocontroller 8051  soft
Microcontroller 8051 soft
 
mup
mupmup
mup
 
Microprocessor system - summarize
Microprocessor system - summarizeMicroprocessor system - summarize
Microprocessor system - summarize
 
432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf432_17EC563_8051-microcontroller-moving-data_notes.pdf
432_17EC563_8051-microcontroller-moving-data_notes.pdf
 
8051assembly language
8051assembly language8051assembly language
8051assembly language
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp011347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01
 
MICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptxMICROCONTROLLERS-module2 (7).pptx
MICROCONTROLLERS-module2 (7).pptx
 
8085 paper-presentation
8085 paper-presentation8085 paper-presentation
8085 paper-presentation
 
Applications of microcontroller(8051)
Applications of microcontroller(8051) Applications of microcontroller(8051)
Applications of microcontroller(8051)
 
Assembly Language
Assembly LanguageAssembly Language
Assembly Language
 
Real Time Embedded System
Real Time Embedded SystemReal Time Embedded System
Real Time Embedded System
 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
 
Mic practicals
Mic practicalsMic practicals
Mic practicals
 
Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine Microprocessor Week 8: Subroutine
Microprocessor Week 8: Subroutine
 

Recently uploaded

Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdfKamal Acharya
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxVishalDeshpande27
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturingssuser0811ec
 
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsRS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsAtif Razi
 
A case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfA case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfKamal Acharya
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientistgettygaming1
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdfPratik Pawar
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerapareshmondalnita
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopEmre Günaydın
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234AafreenAbuthahir2
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfNurvisNavarroSanchez
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdfKamal Acharya
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Krakówbim.edu.pl
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
 
Antenna efficency lecture course chapter 3.pdf
Antenna  efficency lecture course chapter 3.pdfAntenna  efficency lecture course chapter 3.pdf
Antenna efficency lecture course chapter 3.pdfAbrahamGadissa
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfAbrahamGadissa
 

Recently uploaded (20)

Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
Introduction to Casting Processes in Manufacturing
Introduction to Casting Processes in ManufacturingIntroduction to Casting Processes in Manufacturing
Introduction to Casting Processes in Manufacturing
 
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsRS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
A case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfA case study of cinema management system project report..pdf
A case study of cinema management system project report..pdf
 
Top 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering ScientistTop 13 Famous Civil Engineering Scientist
Top 13 Famous Civil Engineering Scientist
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Antenna efficency lecture course chapter 3.pdf
Antenna  efficency lecture course chapter 3.pdfAntenna  efficency lecture course chapter 3.pdf
Antenna efficency lecture course chapter 3.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 

Programs using Microcontrollers.ppt

  • 1. Write a program to transfer 09 bytes of data from external RAM address location 9000H to internal RAM address location 50H. MOV DPTR, #9000H MOV R0, #50H MOV R2, #09H MOVX A, @DPTR MOV @R0, A INC DPTR INC R0 DJNZ R2, L1 HERE: S J M P HERE
  • 2. Write a program to add list of 10 no.s stored from the internal RAM address location 60H. Store the result in the memory location 80H. MOV R0, #60H MOV R1, #80H MOV R2, #0AH MOVX A, #00H MOV R3,#00H L2: ADD A, @R0 JNC L1 INC R3 L1: INC R0 DJNZ R2, L2 MOV @R1, A INC R1 MOV A, @R3 MOV @R1, A HERE: S J MP HERE
  • 3. Write a program to exchange 10 bytes from 50H to 60H. MOV R0, #50H MOV R1, #60H MOV R2, #0AH L1: MOV A, @R0 XCH A, @R0 MOV @R0, A INC R0 INC R1 DJNZ R2, L1 HERE: SJMP HERE
  • 4. Write a program to move 10 bytes of data from internal ROM 0500H to Internal RAM 50H. MOV DPTR, #0500H MOV R0, # 50H MOV R2, #0AH L1: MOVX A, @DPTR MOV @R0, A INC DPTR INC R0 DJNZ R2, L1 HERE: SJMP HERE
  • 5.
  • 6.
  • 7. Develop an Assembly Language Program to find whether a given byte is available in the given sequence or not. If it is available, write FF in R3, otherwise write 00 in R3. MOV R0, #20H MOV R3, #00H MOV R1, #05H BAC K MOV A, @R0 CJNE A, #45H, AHEAD MOV R3, #0FFH INC R0 DJNZ R1, BACK AHEAD HERE S J MP HERE
  • 8. Develop an assembly language program to find average of two eight bit numbers MOV F0 (B), #02H MOV A,R0 ADD A,R1 DIV AB MOV R2, A SJMP HERE HERE:
  • 9. Develop an assembly language program to count the number of 1s and 0s in given byte of data. MOV A, #25H MOV R0, #80H MOV R1, #00H MOV R2, #00H MOV R3, #08H CLR C UP: RRC A JNC DOWN INC R1 SJMP NEXT DOWN: INC R2 NEXT: DJNZ R3, UP MOV A, R1 MOV @R0, A INC R0 MOV A, R2 MOV @R0, A HERE: SJMP HERE
  • 10. Develop a program by using 8051 instructions to multiply two 8- bit numbers present at memory locations 9000H and 9001H and store the result at the memory locations 9050H and 9051H. MOV DPTR, #9000 MOVX A, @DPTR MOV 0F0, A MOV DPTR, #9001 MOVX A, @DPTR MUL AB MOV DPTR, #9050 MOVX @DPTR, A INC DPTR MOV A, 0F0H MOVX @DPTR, A SJMP HERE HERE:
  • 11. Develop a program by using 8051 instructions to divide an 8- bit number present at memory location 8000H with number present at address 8001H and store the quotient at the memory location 8020 and remainder at memory address 8021H. MOV MOVX MOV INC MOVX MOV MOV DIV MOV MOVX INC MOV MOVX SJMP DPTR, #8000H A, @DPTR R0, A DPTR A, @DPTR 0F0, A A, R0 AB DPTR, #8020H @DPTR, A DPTR A, 0F0H @DPTR, A HERE HERE:
  • 12. Develop an assembly language program to find Odd & Even numbers from the given series of numbers. MOV R0, #80H MOV R1, #00H MOV R2, #00H MOV R3, #10H MOV A, @R0 CLR C RRC A JNC DOWN INC R1 SJMP NEXT INC R2 INC R0 DJNZ R3, UP MOV A, R1 MOV @R0, A INC R0 MOV A, R2 MOV @R0, A SJMP HERE UP: DOWN: NEXT: HERE:
  • 13. Develop an assembly language program to find Positive & Negative numbers from the given series of numbers. MOV R0, #90H MOV R1, #00H MOV R2, #00H MOV R3, #10H MOV A, @R0 CLR C RLC A JNC DOWN INC R1 SJMP NEXT INC R2 INC R0 DJNZ R3, UP MOV A, R1 MOV @R0, A INC R0 MOV A, R2 MOV @R0, A UP: DOWN: NEXT: HERE: SJMP HERE