answersLogoWhite

0


Best Answer

MVI B, 09 : Initialize counter

START : LXI H, 2200H: 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

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

sortit movlw 0x30 ;starts here movwf FSR seeifbig movf FSR,W ;check address subwf flag,W btfsc STATUS,Z ;to here return movf INDF,W movwf sTemp1 incf FSR,f ;copy next value movf INDF,W subwf sTemp1,W ;compare it btfsc STATUS,Z ;if 0 chek next value goto seeifbig ; if not check if bigger btfss STATUS,0 ;if bigger swap goto seeifbig ;if not coninue goto swap swap movf INDF,W movwf sTemp2 ;...swap it movf sTemp1,W ; movwf INDF decf FSR,f ; movf sTemp2,W movwf INDF goto sortit ; go back and chec whole list again

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program to arrange the numbers in ascending order using 8085 microprocessor?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What will be the program to arrange numbers stored in array in ascending order using pointers?

sorry


How do you write Ascending order program using 8086 microprocessor?

One many find this answer on YouTube. One also may find out how to write ascending order programs using an 8086 microprocessor by looking at the owners manual.


Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


Could you Write a program for 8086 microprocessor that displays on the monitor the average of 2 numbers from an array?

How to write a program for mouse in microprocessor?


Prime numbers between 1 to 10 in microprocessor 8085?

program to find prime number in 8085 microprocessor


Write a program to add two 8 bit numbers in microprocessor 8051?

write it in 8085


Write a program for which give number in ascending number?

the following program will display all numbers given in the array in ascending order #include<stdio.h> void main() { int i,h,p; int numbers[10]={5,8,3,2,6,7,9,4,1,10}; for(p=0;p<=8;p=p+1) { for(i=0;i<=8;i=i+1) { if(numbers[i]>numbers[i+1]) { a=numbers[i]; numbers[i]=numbers[i+1]; numbers[i+1]=a; } } } for(i=0;i<=9;i=i+1) { printf("%d ",numbers[i]); } }


How do you write a program to read set of numbers using by an array and display the ascending order of the given input numbers?

To write a C++ program to display the student details using class and array of object.


Definition of monitor program in microprocessor?

a program which can be understand by machine.


How can you write a c program to display numbers in ascending order in array?

I know how to do this and you need to know how to do this. Why don't you do your best at writing this program and if it does not work then ask for help. You will not learn anything if I give you the answer.


Types of sorting in 8085 microprocessor?

Sorting is not a microprocessor specific thing. Sorting requires a program and, as such, is not dependent on which microprocessor is involved.


Demonstrate a program that prints numbers in ascending order.?

#include<iostream> int main() { for (int i=0; i<100; ++i) std::cout<<i<<std::endl; }