SlideShare a Scribd company logo
1 of 9
Download to read offline
INTEL 8085
MICROPROCESSOR
ASSEMBLY LANGUAGE PROGRAM
ARRANGE AN ARRAY OF DATA IN
ASCENDING ORDER
Dr. N. ANURADHA
ASSISTANT PROFESSOR OF PHYSICS
BON SECOURS COLLEGE FOR WOMEN,
THANJAVUR
ARRANGE AN ARRAY OF DATA IN ASCENDING ORDER
BOOK : FUNDAMENTALS OF MICROPROCESSOR AND MICROCONTROLLER
AUTHOR : B. RAM
MEMORY
ADDRESS
MACHINE
CODES
LABELS
MNEMONICS
& OPERANDS
COMMENTS
2000 21,00,25 LXI H, 2500 Address of count for number of passes in H-L pair
2003 4E MOV C, M Count for number of passes in register C
2004 21,00,25 BACK LXI H, 2500 Address of count for number of comparisons in H-L pair
2007 56 MOV D, M Count for number of comparisons in register D
2008 23 INX H Address of 1st number in H-L pair
2009 7E MOV A, M 1st number in accumulator
200A 23 LOOP INX H Address of next number
200B 46 MOV B, M Next number in B Register
200C B8 CMP B Compare next number with previous number in Accumulator
200D D2,16,20
JNC AHEAD No Carry, larger number in accumulator. Go to the label AHEAD
Carry present , go to the next instruction.
2010 2B DCX H Decrement the content of H-L Pair
2011 77 MOV M, A Place smaller of the two compared numbers in memory
2012 78 MOV A, B Place greater of the two compared numbers in accumulator
2013 C3,18,20 JMP GO Unconditional Jump
2016 2B AHEAD DCX H Decrement the content of H-L pair
2017 70 MOV M, B Place smaller of the two compared numbers in memory
2018 23 GO INX H Increment the content of H-L Pair
2019 15 DCR D Decrease the count for comparisons
201A C2,0A,20 JNZ LOOP No Zero(D # 0), Go to the label LOOP
201D 77 MOV M,A Place greatest number after a pass in the memory
201E 0D DCR C Decrease the count for passes
201F C2,04,20 JNZ BACK No Zero(C # 0), Go to the label BACK
2022 76 HLT Stop
EXAMPLE 1 : DATA INPUT
2500 = 04
2501 = 60 ( Data – 1 ) 2504 = 15 ( Data – 4 )
2502 = 40 ( Data – 2 ) 2505 = 25 ( Data – 5 )
2503 = 50 ( Data – 3 )
LABEL
MNEMONICS
& OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4
LXI H, 2500 H-L = 2500 = 04
MOV C, M C = 04
BACK LXI H, 2500 H-L = 2500 = 04
MOV D, M D = 04
INX H H-L = 2501 = 60
MOV A, M A = 60
LOOP INX H H-L = 2502 = 40 H-L = 2503 = 50 H-L = 2504 = 15 H-L = 2505 = 25
MOV B, M B = 40 B = 50 B = 15 B = 25
CMP B A - B = 60 - 40, A - B = 60 - 50, A - B = 60 - 15, A - B = 60 - 25,
JNC AHEAD
No carry, Go to the
label AHEAD
No carry, Go to the
label AHEAD
No carry, Go to the
label AHEAD
No carry, Go to the
label AHEAD
DCX H
MOV M, A
MOV A, B
JMP GO
AHEAD DCX H H-L = 2501 H-L = 2502 H-L = 2503 H-L = 2504
MOV M, B 2501 = 40 2502 = 50 2503 = 15 2504 = 25
GO INX H H-L = 2502 H-L = 2503 H-L = 2504 H-L = 2505
DCR D D = 03 D = 02 D = 01 D = 00
JNZ LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
Zero, go to the next
instruction
MOV M,A 2505 = 60
DCR C C=03
JNZ BACK
No zero, go to the
label BACK
HLT
CYCLE - 1
AFTER THE CYCLE 1
2501 = 40 ( Data – 1 ) 2504 = 25 ( Data – 4 )
2502 = 50 ( Data – 2 ) 2505 = 60 ( Data – 5 )
2503 = 15 ( Data – 3 )
LABEL
MNEMONICS
& OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4
LXI H, 2500
MOV C, M
BACK LXI H, 2500 H-L = 2500 = 04
MOV D, M D = 04
INX H H-L = 2501 = 40
MOV A, M A = 40
LOOP INX H H-L = 2502 = 50 H-L = 2503 = 15 H-L = 2504 = 25 H-L = 2505 = 60
MOV B, M B = 50 B = 15 B = 25 B = 60
CMP B A - B = 40 - 50, A-B = 50 - 15 A-B = 50-25 A-B = 50 -60
JNC AHEAD
Carry present, go to
the next instruction
No carry, Go to the
label AHEAD
No carry, Go to the
label AHEAD
Carry present, go to the
next instruction
DCX H H-L = 2501 H-L = 2504
MOV M, A 2501 = 40 2504 = 50
MOV A, B A = 50 A = 60
JMP GO
AHEAD DCX H H-L = 2502 H-L = 2503
MOV M, B 2502 = 15 2503 = 25
GO INX H H-L = 2502 H-L = 2503 H-L = 2504 H-L = 2505
DCR D D = 03 D = 02 D = 01 D=00
JNZ LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
Zero, go to the next
instruction
MOV M,A 2505 = 60
DCR C C=02
JNZ BACK
No zero, go to the
label BACK
HLT
CYCLE - 2
AFTER THE CYCLE 2
2501 = 40 ( Data – 1 ) 2504 = 50 ( Data – 4 )
2502 = 15 ( Data – 2 ) 2505 = 60 ( Data – 5 )
2503 = 25 ( Data – 3 )
LABEL
MNEMONICS
& OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4
LXI H, 2500
MOV C, M
BACK LXI H, 2500 H-L = 2500 = 04
MOV D, M D = 04
INX H H-L = 2501 = 40
MOV A, M A = 40
LOOP INX H H-L = 2502 = 15 H-L = 2503 = 25 H-L = 2504 =50 H-L=2505
MOV B, M B = 15 B=25 B=50 B=60
CMP B A-B = 40 – 15 A-B = 40 -25 A-B = 40-50 A-B=50-60
JNC AHEAD
No carry, Go to the
label AHEAD
No carry, Go to the
label AHEAD
Carry present, go to
the next instruction
Carry present, go to
the next instruction
DCX H H-L=2503 H-L = 2504
MOV M, A 2503=40 2504 = 50
MOV A, B A=50 A=60
JMP GO
AHEAD DCX H H – L = 2501 H-L = 2502
MOV M, B 2501 = 15 2502 =25
GO INX H H-L = 2502 H-L =2503 H-L=2504 H-L = 2505
DCR D D = 03 D =02 D=01 D=00
JNZ LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
Zero, go to the next
instruction
MOV M,A 2505=60
DCR C C=01
JNZ BACK
No zero, go to the
label BACK
HLT
CYCLE - 3
AFTER THE CYCLE 3
2501 = 15 ( Data – 1 ) 2504 = 50 ( Data – 4 )
2502 = 25 ( Data – 2 ) 2505 = 60 ( Data – 5 )
2503 = 40( Data – 3 )
LABEL
MNEMONICS
& OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4
LXI H, 2500
MOV C, M
BACK LXI H, 2500 H-L = 2500 = 04
MOV D, M D = 04
INX H H-L = 2501 = 15
MOV A, M A = 15
LOOP INX H H-L = 2502 = 25 H-L = 2503 = 40 H-L = 2504 =50 H-L=2505
MOV B, M B = 25 B=40 B=50 B=60
CMP B A-B = 15 – 25 A-B = 25 -40 A-B = 40-50 A-B=50-60
JNC AHEAD
Carry present, go to
the next instruction
Carry present, go to
the next instruction
Carry present, go to
the next instruction
Carry present, go to
the next instruction
DCX H H-L = 2501 H – L = 2502 H-L=2503 H-L = 2504
MOV M, A 2501 = 15 2502 = 25 2503=40 2504 = 50
MOV A, B A = 25 A = 40 A=50 A=60
JMP GO
AHEAD DCX H
MOV M, B
GO INX H H-L = 2502 H-L =2503 H-L=2504 H-L = 2505
DCR D D = 03 D =02 D=01 D=00
JNZ LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
No zero, go to the
label LOOP
Zero, go to the next
instruction
MOV M,A 2505=60
DCR C C=00
JNZ BACK
Zero, go to the next
instruction
HLT HLT
CYCLE - 4
DATA INPUT
2500 = 04
2501 = 60 ( Data – 1 )
2502 = 40 ( Data – 2 )
2503 = 50 ( Data – 3 )
2504 = 15 ( Data – 4 )
2505 = 25 ( Data – 5 )
THE FINAL RESULT OF THE PROGRAM
2501 = 15
2502 = 25
2503 = 40
2504 = 50
2505 = 60
THANK YOU

More Related Content

What's hot

Interfacing keypad
Interfacing keypadInterfacing keypad
Interfacing keypadPRADEEP
Β 
8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
Β 
Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareProf. Swapnil V. Kaware
Β 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversionPraveen Kumar
Β 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086Ikhlas Rahman
Β 
Chapter4.1 2-mikroprocessor
Chapter4.1 2-mikroprocessorChapter4.1 2-mikroprocessor
Chapter4.1 2-mikroprocessorteknik komputer ui
Β 
8051 experiments1
8051 experiments18051 experiments1
8051 experiments1tt_aljobory
Β 
8085 interrupts
8085 interrupts8085 interrupts
8085 interruptsRam Babu
Β 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer KitAmit Kumer Podder
Β 
EEP306: pulse width modulation
EEP306: pulse width modulation EEP306: pulse width modulation
EEP306: pulse width modulation Umang Gupta
Β 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
Β 
Schmitt trigger circuit
Schmitt trigger circuitSchmitt trigger circuit
Schmitt trigger circuittaranjeet10
Β 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Piyush Rochwani
Β 
Electrical power ecx3232 lab report
Electrical power ecx3232 lab reportElectrical power ecx3232 lab report
Electrical power ecx3232 lab reportSandun Perera
Β 

What's hot (20)

Interfacing keypad
Interfacing keypadInterfacing keypad
Interfacing keypad
Β 
8086 instructions
8086 instructions8086 instructions
8086 instructions
Β 
Microprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. KawareMicroprocessor Lab Manual by Er. Swapnil V. Kaware
Microprocessor Lab Manual by Er. Swapnil V. Kaware
Β 
8051 Timer
8051 Timer8051 Timer
8051 Timer
Β 
Binary to bcd
Binary to bcdBinary to bcd
Binary to bcd
Β 
(D/A) and (A/D)conversion
(D/A) and (A/D)conversion(D/A) and (A/D)conversion
(D/A) and (A/D)conversion
Β 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086
Β 
Chapter4.1 2-mikroprocessor
Chapter4.1 2-mikroprocessorChapter4.1 2-mikroprocessor
Chapter4.1 2-mikroprocessor
Β 
8051 experiments1
8051 experiments18051 experiments1
8051 experiments1
Β 
8085 interrupts
8085 interrupts8085 interrupts
8085 interrupts
Β 
8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit8086 Micro-processor and MDA 8086 Trainer Kit
8086 Micro-processor and MDA 8086 Trainer Kit
Β 
EEP306: pulse width modulation
EEP306: pulse width modulation EEP306: pulse width modulation
EEP306: pulse width modulation
Β 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
Β 
8051 interrupts
8051 interrupts8051 interrupts
8051 interrupts
Β 
Schmitt trigger circuit
Schmitt trigger circuitSchmitt trigger circuit
Schmitt trigger circuit
Β 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
Β 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
Β 
Electrical power ecx3232 lab report
Electrical power ecx3232 lab reportElectrical power ecx3232 lab report
Electrical power ecx3232 lab report
Β 
8051 ch9-950217
8051 ch9-9502178051 ch9-950217
8051 ch9-950217
Β 
Arithmetic and logical instructions
Arithmetic and logical instructionsArithmetic and logical instructions
Arithmetic and logical instructions
Β 

Similar to Intel 8085 - Arrange an array of data in ascending order

Intel 8085 - Smallest number in a data array
Intel 8085 -  Smallest number in a data arrayIntel 8085 -  Smallest number in a data array
Intel 8085 - Smallest number in a data arrayDEPARTMENT OF PHYSICS
Β 
Intel 8085 largest number in a data array
Intel   8085  largest number in a data arrayIntel   8085  largest number in a data array
Intel 8085 largest number in a data arrayDEPARTMENT OF PHYSICS
Β 
Chp2 introduction to the 68000 microprocessor copy
Chp2 introduction to the 68000 microprocessor   copyChp2 introduction to the 68000 microprocessor   copy
Chp2 introduction to the 68000 microprocessor copymkazree
Β 
11. 8085 programming example iii
11. 8085 programming example iii11. 8085 programming example iii
11. 8085 programming example iiisandip das
Β 
8. 8085 programming example
8. 8085 programming example8. 8085 programming example
8. 8085 programming examplesandip das
Β 
Instruction set class
Instruction set   classInstruction set   class
Instruction set classshiji v r
Β 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085shiji v r
Β 
8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)Ravi Anand
Β 
Instruction Set 8085
Instruction Set 8085Instruction Set 8085
Instruction Set 8085Stupidsid.com
Β 

Similar to Intel 8085 - Arrange an array of data in ascending order (10)

Intel 8085 - Smallest number in a data array
Intel 8085 -  Smallest number in a data arrayIntel 8085 -  Smallest number in a data array
Intel 8085 - Smallest number in a data array
Β 
Intel 8085 largest number in a data array
Intel   8085  largest number in a data arrayIntel   8085  largest number in a data array
Intel 8085 largest number in a data array
Β 
Mupi
MupiMupi
Mupi
Β 
Chp2 introduction to the 68000 microprocessor copy
Chp2 introduction to the 68000 microprocessor   copyChp2 introduction to the 68000 microprocessor   copy
Chp2 introduction to the 68000 microprocessor copy
Β 
11. 8085 programming example iii
11. 8085 programming example iii11. 8085 programming example iii
11. 8085 programming example iii
Β 
8. 8085 programming example
8. 8085 programming example8. 8085 programming example
8. 8085 programming example
Β 
Instruction set class
Instruction set   classInstruction set   class
Instruction set class
Β 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
Β 
8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)
Β 
Instruction Set 8085
Instruction Set 8085Instruction Set 8085
Instruction Set 8085
Β 

More from DEPARTMENT OF PHYSICS (20)

Ruby laser
Ruby laserRuby laser
Ruby laser
Β 
Phototransistor
PhototransistorPhototransistor
Phototransistor
Β 
Photo diode
Photo diodePhoto diode
Photo diode
Β 
Opto electronic devices
Opto electronic devicesOpto electronic devices
Opto electronic devices
Β 
Basics of laser action
Basics of laser actionBasics of laser action
Basics of laser action
Β 
7 Segment Display
7 Segment Display7 Segment Display
7 Segment Display
Β 
Intel 8051 - pin description
Intel 8051  - pin descriptionIntel 8051  - pin description
Intel 8051 - pin description
Β 
MICROCONTROLLER - INTEL 8051
MICROCONTROLLER - INTEL 8051MICROCONTROLLER - INTEL 8051
MICROCONTROLLER - INTEL 8051
Β 
Haemodialysis
HaemodialysisHaemodialysis
Haemodialysis
Β 
Pacemaker
PacemakerPacemaker
Pacemaker
Β 
Cyclotron
CyclotronCyclotron
Cyclotron
Β 
Dia para
Dia paraDia para
Dia para
Β 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
Β 
Superconductor
SuperconductorSuperconductor
Superconductor
Β 
Nuclear physics ppt
Nuclear physics pptNuclear physics ppt
Nuclear physics ppt
Β 
Keplers law
Keplers lawKeplers law
Keplers law
Β 
types of satelite comunication
types of satelite comunicationtypes of satelite comunication
types of satelite comunication
Β 
Nuclear rections ppt
Nuclear rections pptNuclear rections ppt
Nuclear rections ppt
Β 
Keplers law for planetary motion.ppt
Keplers law for planetary motion.pptKeplers law for planetary motion.ppt
Keplers law for planetary motion.ppt
Β 
Satellite
SatelliteSatellite
Satellite
Β 

Recently uploaded

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
Β 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
Β 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
Β 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
Β 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
Β 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
Β 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
Β 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
Β 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
Β 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
Β 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
Β 
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈcall girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ9953056974 Low Rate Call Girls In Saket, Delhi NCR
Β 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
Β 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
Β 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
Β 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
Β 

Recently uploaded (20)

MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
Β 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
Β 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Β 
Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at πŸ”9953056974πŸ”
Β 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
Β 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
Β 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
Β 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
Β 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
Β 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
Β 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
Β 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
Β 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
Β 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
Β 
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈcall girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Kamla Market (DELHI) πŸ” >ΰΌ’9953330565πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
Β 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
Β 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
Β 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
Β 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
Β 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
Β 

Intel 8085 - Arrange an array of data in ascending order

  • 2. ARRANGE AN ARRAY OF DATA IN ASCENDING ORDER Dr. N. ANURADHA ASSISTANT PROFESSOR OF PHYSICS BON SECOURS COLLEGE FOR WOMEN, THANJAVUR
  • 3. ARRANGE AN ARRAY OF DATA IN ASCENDING ORDER BOOK : FUNDAMENTALS OF MICROPROCESSOR AND MICROCONTROLLER AUTHOR : B. RAM MEMORY ADDRESS MACHINE CODES LABELS MNEMONICS & OPERANDS COMMENTS 2000 21,00,25 LXI H, 2500 Address of count for number of passes in H-L pair 2003 4E MOV C, M Count for number of passes in register C 2004 21,00,25 BACK LXI H, 2500 Address of count for number of comparisons in H-L pair 2007 56 MOV D, M Count for number of comparisons in register D 2008 23 INX H Address of 1st number in H-L pair 2009 7E MOV A, M 1st number in accumulator 200A 23 LOOP INX H Address of next number 200B 46 MOV B, M Next number in B Register 200C B8 CMP B Compare next number with previous number in Accumulator 200D D2,16,20 JNC AHEAD No Carry, larger number in accumulator. Go to the label AHEAD Carry present , go to the next instruction. 2010 2B DCX H Decrement the content of H-L Pair 2011 77 MOV M, A Place smaller of the two compared numbers in memory 2012 78 MOV A, B Place greater of the two compared numbers in accumulator 2013 C3,18,20 JMP GO Unconditional Jump 2016 2B AHEAD DCX H Decrement the content of H-L pair 2017 70 MOV M, B Place smaller of the two compared numbers in memory 2018 23 GO INX H Increment the content of H-L Pair 2019 15 DCR D Decrease the count for comparisons 201A C2,0A,20 JNZ LOOP No Zero(D # 0), Go to the label LOOP 201D 77 MOV M,A Place greatest number after a pass in the memory 201E 0D DCR C Decrease the count for passes 201F C2,04,20 JNZ BACK No Zero(C # 0), Go to the label BACK 2022 76 HLT Stop
  • 4. EXAMPLE 1 : DATA INPUT 2500 = 04 2501 = 60 ( Data – 1 ) 2504 = 15 ( Data – 4 ) 2502 = 40 ( Data – 2 ) 2505 = 25 ( Data – 5 ) 2503 = 50 ( Data – 3 ) LABEL MNEMONICS & OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4 LXI H, 2500 H-L = 2500 = 04 MOV C, M C = 04 BACK LXI H, 2500 H-L = 2500 = 04 MOV D, M D = 04 INX H H-L = 2501 = 60 MOV A, M A = 60 LOOP INX H H-L = 2502 = 40 H-L = 2503 = 50 H-L = 2504 = 15 H-L = 2505 = 25 MOV B, M B = 40 B = 50 B = 15 B = 25 CMP B A - B = 60 - 40, A - B = 60 - 50, A - B = 60 - 15, A - B = 60 - 25, JNC AHEAD No carry, Go to the label AHEAD No carry, Go to the label AHEAD No carry, Go to the label AHEAD No carry, Go to the label AHEAD DCX H MOV M, A MOV A, B JMP GO AHEAD DCX H H-L = 2501 H-L = 2502 H-L = 2503 H-L = 2504 MOV M, B 2501 = 40 2502 = 50 2503 = 15 2504 = 25 GO INX H H-L = 2502 H-L = 2503 H-L = 2504 H-L = 2505 DCR D D = 03 D = 02 D = 01 D = 00 JNZ LOOP No zero, go to the label LOOP No zero, go to the label LOOP No zero, go to the label LOOP Zero, go to the next instruction MOV M,A 2505 = 60 DCR C C=03 JNZ BACK No zero, go to the label BACK HLT CYCLE - 1
  • 5. AFTER THE CYCLE 1 2501 = 40 ( Data – 1 ) 2504 = 25 ( Data – 4 ) 2502 = 50 ( Data – 2 ) 2505 = 60 ( Data – 5 ) 2503 = 15 ( Data – 3 ) LABEL MNEMONICS & OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4 LXI H, 2500 MOV C, M BACK LXI H, 2500 H-L = 2500 = 04 MOV D, M D = 04 INX H H-L = 2501 = 40 MOV A, M A = 40 LOOP INX H H-L = 2502 = 50 H-L = 2503 = 15 H-L = 2504 = 25 H-L = 2505 = 60 MOV B, M B = 50 B = 15 B = 25 B = 60 CMP B A - B = 40 - 50, A-B = 50 - 15 A-B = 50-25 A-B = 50 -60 JNC AHEAD Carry present, go to the next instruction No carry, Go to the label AHEAD No carry, Go to the label AHEAD Carry present, go to the next instruction DCX H H-L = 2501 H-L = 2504 MOV M, A 2501 = 40 2504 = 50 MOV A, B A = 50 A = 60 JMP GO AHEAD DCX H H-L = 2502 H-L = 2503 MOV M, B 2502 = 15 2503 = 25 GO INX H H-L = 2502 H-L = 2503 H-L = 2504 H-L = 2505 DCR D D = 03 D = 02 D = 01 D=00 JNZ LOOP No zero, go to the label LOOP No zero, go to the label LOOP No zero, go to the label LOOP Zero, go to the next instruction MOV M,A 2505 = 60 DCR C C=02 JNZ BACK No zero, go to the label BACK HLT CYCLE - 2
  • 6. AFTER THE CYCLE 2 2501 = 40 ( Data – 1 ) 2504 = 50 ( Data – 4 ) 2502 = 15 ( Data – 2 ) 2505 = 60 ( Data – 5 ) 2503 = 25 ( Data – 3 ) LABEL MNEMONICS & OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4 LXI H, 2500 MOV C, M BACK LXI H, 2500 H-L = 2500 = 04 MOV D, M D = 04 INX H H-L = 2501 = 40 MOV A, M A = 40 LOOP INX H H-L = 2502 = 15 H-L = 2503 = 25 H-L = 2504 =50 H-L=2505 MOV B, M B = 15 B=25 B=50 B=60 CMP B A-B = 40 – 15 A-B = 40 -25 A-B = 40-50 A-B=50-60 JNC AHEAD No carry, Go to the label AHEAD No carry, Go to the label AHEAD Carry present, go to the next instruction Carry present, go to the next instruction DCX H H-L=2503 H-L = 2504 MOV M, A 2503=40 2504 = 50 MOV A, B A=50 A=60 JMP GO AHEAD DCX H H – L = 2501 H-L = 2502 MOV M, B 2501 = 15 2502 =25 GO INX H H-L = 2502 H-L =2503 H-L=2504 H-L = 2505 DCR D D = 03 D =02 D=01 D=00 JNZ LOOP No zero, go to the label LOOP No zero, go to the label LOOP No zero, go to the label LOOP Zero, go to the next instruction MOV M,A 2505=60 DCR C C=01 JNZ BACK No zero, go to the label BACK HLT CYCLE - 3
  • 7. AFTER THE CYCLE 3 2501 = 15 ( Data – 1 ) 2504 = 50 ( Data – 4 ) 2502 = 25 ( Data – 2 ) 2505 = 60 ( Data – 5 ) 2503 = 40( Data – 3 ) LABEL MNEMONICS & OPERANDS STEP : 1 STEP : 2 STEP : 3 STEP : 4 LXI H, 2500 MOV C, M BACK LXI H, 2500 H-L = 2500 = 04 MOV D, M D = 04 INX H H-L = 2501 = 15 MOV A, M A = 15 LOOP INX H H-L = 2502 = 25 H-L = 2503 = 40 H-L = 2504 =50 H-L=2505 MOV B, M B = 25 B=40 B=50 B=60 CMP B A-B = 15 – 25 A-B = 25 -40 A-B = 40-50 A-B=50-60 JNC AHEAD Carry present, go to the next instruction Carry present, go to the next instruction Carry present, go to the next instruction Carry present, go to the next instruction DCX H H-L = 2501 H – L = 2502 H-L=2503 H-L = 2504 MOV M, A 2501 = 15 2502 = 25 2503=40 2504 = 50 MOV A, B A = 25 A = 40 A=50 A=60 JMP GO AHEAD DCX H MOV M, B GO INX H H-L = 2502 H-L =2503 H-L=2504 H-L = 2505 DCR D D = 03 D =02 D=01 D=00 JNZ LOOP No zero, go to the label LOOP No zero, go to the label LOOP No zero, go to the label LOOP Zero, go to the next instruction MOV M,A 2505=60 DCR C C=00 JNZ BACK Zero, go to the next instruction HLT HLT CYCLE - 4
  • 8. DATA INPUT 2500 = 04 2501 = 60 ( Data – 1 ) 2502 = 40 ( Data – 2 ) 2503 = 50 ( Data – 3 ) 2504 = 15 ( Data – 4 ) 2505 = 25 ( Data – 5 ) THE FINAL RESULT OF THE PROGRAM 2501 = 15 2502 = 25 2503 = 40 2504 = 50 2505 = 60