answersLogoWhite

0


Best Answer

LXI H,C000H //the length of the string is in C000 memory location//

MOV C,M

MVI E,00H

LOOP1: LXI H,C001H // string starts from C001 H //

MOV B,C

INX H

CMP M

JNC LOOP3

JZ LOOP3

MOV D,M

INR E // THIS IS TO CHECK WHETHER THE STRING IS ALREADY

SORTED OR NOT //

MOV M,A

DCX H

MOV M,D

INX H

LOOP3: DCR B

JNZ LOOP2

MOV A,E

SUI 00H

JZ LOOP4

DCR C

JNZ LOOP1

LOOP4: HLT

User Avatar

Wiki User

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

Wiki User

14y ago

Thatz it !!!!! Sorting 6 numbers in memory starting from 0060H hex address (Selection sort algo) -------------------------

LXI H, 0060H

MVI B, 05H

LOOP1: MOV C, B

MOV D, H

MOV E, L

INR E

LOOP2: LDAX D

CMP M

JNC NO_SWP

SWAP: MOV D, M

MOV M, A

MOV A, D

MOV D, H

STAX D

NO_SWP: INR E

DCR C

JNZ LOOP2

INX H

DCR B

JNZ LOOP1

HLT

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

code segment assume cs:code,ds:data mov ax,data mov ds,ax mov cx,n mov si,0000 outer : mov ax,arr[si] mov di,si sub di,2 inner : cmp di,00h jb over cmp ax,arr[di] jae over mov bx,arr[di] mov arr[di+2],bx sub di,2 jmp inner over : mov arr[di+2],ax add si,2 loop outer mov ah,4ch int 21h code ends data segment arr dw 0007h,0002h,0003h,0100h,0001h n dw 5 data ends end

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

This is not a question, it's a project

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write 8085 program on selection sort algorithm?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

2x2 matrix multiplication program in 8085 processor?

how to write a program for matrix multiplication in microprocesspr


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

write it in 8085


How do you write a program in 8085?

Either in Assembly or in some high level language/the hex-code (for the mnemonics) that the microprocessor 8085 generally understands.


Program for interfacing of relay with 8085?

we want relay interface with 8085 and also attech the program


Write a program to eliminate the blanks from string 8085?

public class RemoveSpace{ public static void main(String args[]){ String str = "8085"; Sysytem.out.println(str.trim()); } } Get The Desired OutPut....


Write a program to set all flags of 8085?

; Exact answer: LXI H, FFFFH push H POP PSW


Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix?

Sp[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Answer]]ell chec[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix&action=edit&section=new|Answer it!]]k your answe[[Q/Discuss:Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Disc]][[help/answering questions|guidelin]]Spell check your answeresussionr[[help/signing in|full benefits]] Save C[[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix|Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 ]][[Q/Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix&action=edit&section=new|Answering 'Write a 8085 microprocessor program to find A inverse and A transpose if A is a 3x3 matrix?']]matrix?ancel[[Q/How many animals are in West Texas|How many animals are in West Texas?]][[Q/How do you increase the number of four wheelers vehicles for servicing in a Service workshop|How do you increase the number of four wheelers vehicles for servicing in a]][[Q/How do you increase the number of four wheelers vehicles for servicing in a Service workshop|How do you increase the number of four wheelers vehicles for servicing in a Service workshop?]] Service workshop?[[Q/How do you increase the number of four wheelers vehicles for servicing in a Service workshop|How do you increase the number of four wheelers vehicles for servicing in a Service workshop?]]More Q&A


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.


Prime numbers between 1 to 10 in microprocessor 8085?

program to find prime number in 8085 microprocessor


Program to convert hex to decimal in 8085?

jump,b


How can you write a program to convert binary code to gray code using 8085 microprocessor?

It can be implemented very easily .... Suppose the Binary word is X7X6X5.... X0 then the corresponding Gray code is G7G6G5....G0 where G7=X7 G6=X7 XOR X6 G5=X6 XOR X5 ..... G0=X1 XOR X0 Now implement the above algorithm


What is subroutine in 8085?

in 8085 microprocessor a subroutine is a separate program written aside from main program ,this program is basically the program which requires to be executed several times in the main program. the microprocessor can call subroutine any time using CALL instruction . after the subroutine is executed the subbroutine hands over the program to main program using RET instruction.