google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: Write a program for 8085 microprocessor to arrange first 10 numbers from memory address 3000H in an ascending order.

Saturday, December 28, 2019

Write a program for 8085 microprocessor to arrange first 10 numbers from memory address 3000H in an ascending order.

Write a program for 8085 microprocessor to arrange first 10 numbers from memory address 3000H in an ascending order.

Answer: 

MVI B, 09                  :"Initialize counter"     
START                       :"LXI H, 3000H: Initialize memory pointer"
MVI C, 09H               :"Initialize counter 2"
BACK: MOV A, M   :"Get the number"
INX H                        :"Increment memory pointer"
CMP M                      :"Compare number with next number"
JC SKIP                     :"If less, don’t interchange"
JZ SKIP                     :"If equal, don’t interchange"
MOV D, M
MOV M, A
DCX H
MOV M, D
INX H                      :"Interchange two numbers"
SKIP:DCR C           :"Decrement counter 2"
JNZ BACK              :"If not zero, repeat"
DCR B                     :"Decrement counter 1"
JNZ START
HLT                         :"Terminate program execution"

1 comment:

  1. Discover the captivating tapestry of nations and their vibrant epicenters with our comprehensive guide on Countries of the World and Their Capitals. Unearth a treasure trove of invaluable information as we navigate through the rich cultural diversity, historical landmarks, and fascinating anecdotes that make each country and its capital a distinctive masterpiece. From the bustling streets of Paris to the ancient wonders of Beijing, embark on an SEO-friendly expedition that will leave you awe-inspired and well-informed about the global tapestry that connects us all.

    ReplyDelete

शिव भोलेनाथ स्तुति

 जय शिवशंकर, जय गंगाधर, करुणा-कर करतार हरे,   जय कैलाशी, जय अविनाशी, सुखराशि, सुख-सार हरे जय शशि-शेखर, जय डमरू-धर जय-जय प्रेमागार हरे,   जय ...