SlideShare a Scribd company logo
1 of 10
8051
Part IV
8051 ALP to generate first 10 even numbers
● org 0h
mov r0, #01h
mov r4, #50h
mov r1, #30h
back: mov a, r0
rrc a
jc odd
mov a, r0
mov @r1, a
inc r0
inc r1
inc r5
cjne r5, #0ah, last
sjmp last2
odd:inc r0
last: nop
djnz r4, back
last2: nop
end
8051 ALP to generate first 10 odd numbers
● org 0h
mov r0, #01h
mov r4, #50h
mov r1, #30h
back: mov a, r0rrc a
jnc even
mov a, r0
mov @r1, a
inc r0
inc r1
inc r5
cjne r5, #0ah, last
sjmp last2
even:inc r0
last: nop
djnz r4, back
last2: nop
end
8051 ALP to generate first 10 square numbers
● org 0h
mov r0, #1h
mov r1, #30h
mov r4, #09h
mov 30h, #1h
back: inc r0
inc r1
mov a, r0
mov b, r0
mul ab
mov @r1, a
djnz r4, back
end
8051 ALP to generate first 10 cube numbers
● org 0h
mov r0, #1h
mov r1, #30h
mov r4, #06h
mov 30h, #1h
back: inc r0
inc r1
mov a, r0
mov b, r0
mul ab
mov b, r0
mul ab
mov @r1, a
djnz r4, back
end
8051 ALP generation of fibonacci series
● org 0h
mov r0, #20h
mov r1, #1h
mov r2, #1h
mov r4, #8h
mov @r0, #1h
inc r0
mov @r0, #1h
back: inc r0
mov a, r2
addc a, r1
mov @r0, a
mov 19h, r2
mov r1, 19h
mov r2, a
djnz r4, back
end
THANK YOU
THANK YOU

More Related Content

Similar to 8051 -4 (8)

Microcontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsMicrocontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprograms
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
 
Winter training,Readymade Projects,Buy Projects,Corporate Training
Winter training,Readymade Projects,Buy Projects,Corporate TrainingWinter training,Readymade Projects,Buy Projects,Corporate Training
Winter training,Readymade Projects,Buy Projects,Corporate Training
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
 
ARM Architecture Instruction Set
ARM Architecture Instruction SetARM Architecture Instruction Set
ARM Architecture Instruction Set
 
Arm chap 3 last
Arm chap 3 lastArm chap 3 last
Arm chap 3 last
 

Recently uploaded

Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
BalamuruganV28
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
benjamincojr
 

Recently uploaded (20)

Circuit Breakers for Engineering Students
Circuit Breakers for Engineering StudentsCircuit Breakers for Engineering Students
Circuit Breakers for Engineering Students
 
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
NO1 Best Powerful Vashikaran Specialist Baba Vashikaran Specialist For Love V...
 
Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...Fuzzy logic method-based stress detector with blood pressure and body tempera...
Fuzzy logic method-based stress detector with blood pressure and body tempera...
 
handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Final DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manualFinal DBMS Manual (2).pdf final lab manual
Final DBMS Manual (2).pdf final lab manual
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdf
 
Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...Developing a smart system for infant incubators using the internet of things ...
Developing a smart system for infant incubators using the internet of things ...
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
electrical installation and maintenance.
electrical installation and maintenance.electrical installation and maintenance.
electrical installation and maintenance.
 
Insurance management system project report.pdf
Insurance management system project report.pdfInsurance management system project report.pdf
Insurance management system project report.pdf
 
Intro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniIntro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney Uni
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
 
Adsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) pptAdsorption (mass transfer operations 2) ppt
Adsorption (mass transfer operations 2) ppt
 
15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon15-Minute City: A Completely New Horizon
15-Minute City: A Completely New Horizon
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Autodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptxAutodesk Construction Cloud (Autodesk Build).pptx
Autodesk Construction Cloud (Autodesk Build).pptx
 

8051 -4

  • 2. 8051 ALP to generate first 10 even numbers ● org 0h mov r0, #01h mov r4, #50h mov r1, #30h back: mov a, r0 rrc a jc odd mov a, r0 mov @r1, a inc r0 inc r1
  • 3. inc r5 cjne r5, #0ah, last sjmp last2 odd:inc r0 last: nop djnz r4, back last2: nop end
  • 4. 8051 ALP to generate first 10 odd numbers ● org 0h mov r0, #01h mov r4, #50h mov r1, #30h back: mov a, r0rrc a jnc even mov a, r0 mov @r1, a inc r0 inc r1 inc r5
  • 5. cjne r5, #0ah, last sjmp last2 even:inc r0 last: nop djnz r4, back last2: nop end
  • 6. 8051 ALP to generate first 10 square numbers ● org 0h mov r0, #1h mov r1, #30h mov r4, #09h mov 30h, #1h back: inc r0 inc r1 mov a, r0 mov b, r0 mul ab mov @r1, a djnz r4, back end
  • 7. 8051 ALP to generate first 10 cube numbers ● org 0h mov r0, #1h mov r1, #30h mov r4, #06h mov 30h, #1h back: inc r0 inc r1 mov a, r0 mov b, r0 mul ab mov b, r0 mul ab mov @r1, a djnz r4, back end
  • 8. 8051 ALP generation of fibonacci series ● org 0h mov r0, #20h mov r1, #1h mov r2, #1h mov r4, #8h mov @r0, #1h inc r0 mov @r0, #1h back: inc r0 mov a, r2 addc a, r1 mov @r0, a mov 19h, r2 mov r1, 19h mov r2, a djnz r4, back end