SlideShare a Scribd company logo
8051
Part III
8051 ALP to find number of negative numbers in
an array of 10 numbers
● org 0h
mov r3, #05h
mov r0, #40h
check: mov a, @r0
inc r0
rlc a
jnc down
inc r5
down: djnz r3, check
end
8051 ALP to find the number of odd numbers in an
array of 10 numbers
● org 0h
mov r3, #05h
mov r0, #40h
check: mov a, @r0
inc r0
rrc a
jnc down
inc r5
down: djnz r3, check
end
8051 ALP to find number of even numbers in an
array of 10 numbers
● org 0h
mov r3, #05h
mov r0, #40h
check: mov a, @r0
inc r0
rrc a
jc down
inc r5
down: djnz r3, check
end
8051 ALP to count the number of 1’s in a given 8-bit
number
● org 0h
mov a, 20h
mov r0, #07h
back: rrc a
jnc down
inc r1
down:djnz r0, back
end
8051 ALP to count the number of 0’s in a given 8-bit
number
● org 0h
mov a, 20h
mov r0, #07h
back: rrc a
jc down
inc r1
down:djnz r0, back
end
8051 ALP to find average of all positive numbers
in an array of 10 numbers
● org 0h
mov r3, #0ah
mov r3, #40h
check: mov a, @r0
mov r6, a
inc r0
rlc a
jc down
inc r5
mov a, r7
addc a, r6
mov r7, a
down: djnz r3, check
mov b, r5
div ab
mov 50h, a
end
8051ALP to find average of all negative numbers
in an array of 10 numbers
● org 0h
mov r3, #0ah
mov r3, #40h
check: mov a, @r0
mov r6, a
inc r0
rlc a
jnc down
inc r5
mov a, r7
addc a, r6
mov r7, a
down: djnz r3, check
mov b, r5
div ab
mov 50h, a
end
8051 ALP to check greatest of 2 numbers
● org 0h
mov a, 51h
subb a, 50h
jc down
mov 20h, 51h
sjmp stop
down:mov 20h, 50h
stop: nop
end
8051 ALP to find smaller number
● org 0h
mov a, 51h
subb a, 50h
jnc down
mov 20h, 51h
sjmp stop
down:mov 20h, 50h
stop: nop
end
8051 ALP to find largest number in an array of 5
numbers
● org 0h
mov r0, #40h
mov r2, #4h
mov 50h, 40h
back:mov a, @r0
inc r0
subb a, @r0
jnc down
mov 50h, @r0
down: djnz r2, back
end
8051 ALP to find smallest number in an array of 5
numbers
● org 0h
mov r0, #40h
mov r2, #4h
mov 50h, 40h
back:mov a, @r0
inc r0
subb a, @r0
jc down
mov 50h, @r0
down: djnz r2, back
end
8051 ALP to sort array in descending order
● org 0h
mov r5, #4h
backo: mov r4, #4h
mov r0, #20h
mov r1, #21h
backin: mov a,@r0
mov 50h, a
mov b,@r1
subb a, b
jc down
sjmp last
down: mov a, 50h
xch a,@r1
xch a,@r0
last: inc r0
inc r1
djnz r4, backin
djnz r5, backo
end
8051 ALP to sort array in ascending order
● org 0h
mov r5, #4h
backo: mov r4, #4h
mov r0, #20h
mov r1, #21h
backin: mov a,@r0
mov 50h, a
mov b,@r1
subb a, b
jnc down
sjmp last
down: mov a, 50h
xch a,@r1
xch a,@r0
last: inc r0
inc r1
djnz r4, backin
djnz r5, backo
end
8051 ALP unpacked BCD to ASCII code conversion
● org 0h
mov a, #5h
add a, #30h
mov 40h, a
end
8051 ALP ASCII to unpacked BCD code conversion
● org 0h
mov a, #35h
subb a, #30h
mov 40h, a
end
8051 ALP packed BCD TO ASCII code conversion
● org 0h
mov a, 50h
mov r0, 50h
anl a, #0fh
add a, #30h
mov 41h, a
mov a, r0
swap a
anl a, #0fh
add a, #30h
mov 40h, a
end
8051 ALP ASCII to PACKED BCD code conversion
● org 0h
mov a, 41h
subb a, #30h
mov 51h, a
mov a, 40h
subb a, #30h
swap a
orl a, 51h
mov 50h, a
end
8051 ALP to convert BINARY TO GRAY codes
● org 0h
mov a,40h
rrc a
xrl a,40h
end
8051 ALP HEX to DECIMAL code conversion
● org 0h
mov a, 20h
mov b, #0ah
div ab
swap a
orl a, b
mov 50h, a
end
THANK YOU

More Related Content

What's hot

Static characteristics
Static characteristicsStatic characteristics
Static characteristics
ram eluri
 
Difference b/w 8085 & 8086
Difference b/w 8085 & 8086Difference b/w 8085 & 8086
Difference b/w 8085 & 8086
j4jiet
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
Mathivanan Natarajan
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
Gopal Krishna Murthy C R
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
deval patel
 
Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)
Moe Moe Myint
 
Interfacing rs232
Interfacing rs232Interfacing rs232
Interfacing rs232
PRADEEP
 
An application of 8085 register interfacing with LED
An application  of 8085 register interfacing with LEDAn application  of 8085 register interfacing with LED
An application of 8085 register interfacing with LED
Taha Malampatti
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
hello_priti
 
Interrupts for PIC18
Interrupts for PIC18Interrupts for PIC18
Interrupts for PIC18
raosandy11
 
DAC and sensor interfacing with PIC
DAC and sensor interfacing with PICDAC and sensor interfacing with PIC
DAC and sensor interfacing with PIC
Sasidharan Srinivasan
 
Speed Control of DC Motor
Speed Control of DC MotorSpeed Control of DC Motor
Speed Control of DC Motor
Mafaz Ahmed
 
Signals & Systems PPT
Signals & Systems PPTSignals & Systems PPT
Signals & Systems PPT
Jay Baria
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
Vijay Kumar
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
Vikas Gupta
 
System bus timing 8086
System bus timing 8086System bus timing 8086
System bus timing 8086
mpsrekha83
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
Mathivanan Natarajan
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
anishgoel
 
Lm 35
Lm 35Lm 35
Unit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionUnit II Arm7 Thumb Instruction
Unit II Arm7 Thumb Instruction
Dr. Pankaj Zope
 

What's hot (20)

Static characteristics
Static characteristicsStatic characteristics
Static characteristics
 
Difference b/w 8085 & 8086
Difference b/w 8085 & 8086Difference b/w 8085 & 8086
Difference b/w 8085 & 8086
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
 
Memory & I/O interfacing
Memory & I/O  interfacingMemory & I/O  interfacing
Memory & I/O interfacing
 
Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)Introduction to Embedded System I: Chapter 2 (5th portion)
Introduction to Embedded System I: Chapter 2 (5th portion)
 
Interfacing rs232
Interfacing rs232Interfacing rs232
Interfacing rs232
 
An application of 8085 register interfacing with LED
An application  of 8085 register interfacing with LEDAn application  of 8085 register interfacing with LED
An application of 8085 register interfacing with LED
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
Interrupts for PIC18
Interrupts for PIC18Interrupts for PIC18
Interrupts for PIC18
 
DAC and sensor interfacing with PIC
DAC and sensor interfacing with PICDAC and sensor interfacing with PIC
DAC and sensor interfacing with PIC
 
Speed Control of DC Motor
Speed Control of DC MotorSpeed Control of DC Motor
Speed Control of DC Motor
 
Signals & Systems PPT
Signals & Systems PPTSignals & Systems PPT
Signals & Systems PPT
 
8086 Interrupts & With DOS and BIOS by vijay
8086 Interrupts &  With DOS and BIOS  by vijay8086 Interrupts &  With DOS and BIOS  by vijay
8086 Interrupts & With DOS and BIOS by vijay
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
System bus timing 8086
System bus timing 8086System bus timing 8086
System bus timing 8086
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
8051 Microcontroller I/O ports
8051 Microcontroller I/O ports8051 Microcontroller I/O ports
8051 Microcontroller I/O ports
 
Lm 35
Lm 35Lm 35
Lm 35
 
Unit II Arm7 Thumb Instruction
Unit II Arm7 Thumb InstructionUnit II Arm7 Thumb Instruction
Unit II Arm7 Thumb Instruction
 

Similar to 8051 -3

8051 -4
8051 -48051 -4
8051 -2
8051 -28051 -2
8051
80518051
Programs using Microcontrollers.ppt
Programs using Microcontrollers.pptPrograms using Microcontrollers.ppt
Programs using Microcontrollers.ppt
SasiBhushan22
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
Noor Tahasildar
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
noorahamed tahasildar
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments Maicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
noorahamed tahasildar
 
Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)
Noor Tahasildar
 
ch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPT
ch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPTch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPT
ch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPT
FutureTechnologies3
 
assembly
assemblyassembly
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp011347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01
bvenkanna
 
Arm chap 3 last
Arm chap 3 lastArm chap 3 last
Arm chap 3 last
Kalrav Parsana
 
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
Technogroovy
 
New text document
New text documentNew text document
New text document
zocaniveb
 
mup
mupmup

Similar to 8051 -3 (15)

8051 -4
8051 -48051 -4
8051 -4
 
8051 -2
8051 -28051 -2
8051 -2
 
8051
80518051
8051
 
Programs using Microcontrollers.ppt
Programs using Microcontrollers.pptPrograms using Microcontrollers.ppt
Programs using Microcontrollers.ppt
 
Maicrocontroller lab basic experiments
Maicrocontroller lab basic experimentsMaicrocontroller lab basic experiments
Maicrocontroller lab basic experiments
 
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
 
Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)Micro Controller lab basic experiments (1)
Micro Controller lab basic experiments (1)
 
ch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPT
ch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPTch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPT
ch5-bottomupparser_jfdrhgfrfyyssf-gfrrt.PPT
 
assembly
assemblyassembly
assembly
 
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp011347 assemblylanguageprogrammingof8051-100523023308-phpapp01
1347 assemblylanguageprogrammingof8051-100523023308-phpapp01
 
Arm chap 3 last
Arm chap 3 lastArm chap 3 last
Arm chap 3 last
 
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
 
New text document
New text documentNew text document
New text document
 
mup
mupmup
mup
 

Recently uploaded

Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
enizeyimana36
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 

Recently uploaded (20)

Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball playEric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
Eric Nizeyimana's document 2006 from gicumbi to ttc nyamata handball play
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 

8051 -3

  • 2. 8051 ALP to find number of negative numbers in an array of 10 numbers ● org 0h mov r3, #05h mov r0, #40h check: mov a, @r0 inc r0 rlc a jnc down inc r5 down: djnz r3, check end
  • 3. 8051 ALP to find the number of odd numbers in an array of 10 numbers ● org 0h mov r3, #05h mov r0, #40h check: mov a, @r0 inc r0 rrc a jnc down inc r5 down: djnz r3, check end
  • 4. 8051 ALP to find number of even numbers in an array of 10 numbers ● org 0h mov r3, #05h mov r0, #40h check: mov a, @r0 inc r0 rrc a jc down inc r5 down: djnz r3, check end
  • 5. 8051 ALP to count the number of 1’s in a given 8-bit number ● org 0h mov a, 20h mov r0, #07h back: rrc a jnc down inc r1 down:djnz r0, back end
  • 6. 8051 ALP to count the number of 0’s in a given 8-bit number ● org 0h mov a, 20h mov r0, #07h back: rrc a jc down inc r1 down:djnz r0, back end
  • 7. 8051 ALP to find average of all positive numbers in an array of 10 numbers ● org 0h mov r3, #0ah mov r3, #40h check: mov a, @r0 mov r6, a inc r0 rlc a jc down inc r5 mov a, r7 addc a, r6 mov r7, a down: djnz r3, check mov b, r5 div ab mov 50h, a end
  • 8. 8051ALP to find average of all negative numbers in an array of 10 numbers ● org 0h mov r3, #0ah mov r3, #40h check: mov a, @r0 mov r6, a inc r0 rlc a jnc down inc r5 mov a, r7 addc a, r6 mov r7, a down: djnz r3, check mov b, r5 div ab mov 50h, a end
  • 9. 8051 ALP to check greatest of 2 numbers ● org 0h mov a, 51h subb a, 50h jc down mov 20h, 51h sjmp stop down:mov 20h, 50h stop: nop end
  • 10. 8051 ALP to find smaller number ● org 0h mov a, 51h subb a, 50h jnc down mov 20h, 51h sjmp stop down:mov 20h, 50h stop: nop end
  • 11. 8051 ALP to find largest number in an array of 5 numbers ● org 0h mov r0, #40h mov r2, #4h mov 50h, 40h back:mov a, @r0 inc r0 subb a, @r0 jnc down mov 50h, @r0 down: djnz r2, back end
  • 12. 8051 ALP to find smallest number in an array of 5 numbers ● org 0h mov r0, #40h mov r2, #4h mov 50h, 40h back:mov a, @r0 inc r0 subb a, @r0 jc down mov 50h, @r0 down: djnz r2, back end
  • 13. 8051 ALP to sort array in descending order ● org 0h mov r5, #4h backo: mov r4, #4h mov r0, #20h mov r1, #21h backin: mov a,@r0 mov 50h, a mov b,@r1 subb a, b jc down sjmp last down: mov a, 50h xch a,@r1 xch a,@r0 last: inc r0 inc r1 djnz r4, backin djnz r5, backo end
  • 14. 8051 ALP to sort array in ascending order ● org 0h mov r5, #4h backo: mov r4, #4h mov r0, #20h mov r1, #21h backin: mov a,@r0 mov 50h, a mov b,@r1 subb a, b jnc down sjmp last down: mov a, 50h xch a,@r1 xch a,@r0 last: inc r0 inc r1 djnz r4, backin djnz r5, backo end
  • 15. 8051 ALP unpacked BCD to ASCII code conversion ● org 0h mov a, #5h add a, #30h mov 40h, a end
  • 16. 8051 ALP ASCII to unpacked BCD code conversion ● org 0h mov a, #35h subb a, #30h mov 40h, a end
  • 17. 8051 ALP packed BCD TO ASCII code conversion ● org 0h mov a, 50h mov r0, 50h anl a, #0fh add a, #30h mov 41h, a mov a, r0 swap a anl a, #0fh add a, #30h mov 40h, a end
  • 18. 8051 ALP ASCII to PACKED BCD code conversion ● org 0h mov a, 41h subb a, #30h mov 51h, a mov a, 40h subb a, #30h swap a orl a, 51h mov 50h, a end
  • 19. 8051 ALP to convert BINARY TO GRAY codes ● org 0h mov a,40h rrc a xrl a,40h end
  • 20. 8051 ALP HEX to DECIMAL code conversion ● org 0h mov a, 20h mov b, #0ah div ab swap a orl a, b mov 50h, a end