SlideShare a Scribd company logo
1 of 13
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

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 

Recently uploaded (20)

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 

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