Monday, 18 July 2016

Write a program in assembly language(8085) for sorting some consecutive memories.


ORG 0100H
        MVI E, 05H
LOOP: LXI H, 300H
DCR E
MOV C, E
LOOP1: MOV A, M
INX H
CMP M
JC LOOP3
LOOP2: MOV B, M
MOV M, A
DCX H
MOV M, B
        INX H
LOOP3: DCR C
JNZ LOOP1
MOV A, E
CPI 01H
JNZ LOOP
HLT
ORG 0300H
DB 13H, 10H, 60H, 34H, 05H (Here 13H=19, 10H=160, 60H=960, 34H=544 )
END

No comments:

Post a Comment

Popular Posts