8086 program Write an ALP to perform sorting of array in ascending order.

Code :-

org 100h

MOV SI,2000H

MOV DI,2000H

MOV DL,04H

L3: MOV AL,[SI]

MOV CL,DL

L2: INC SI

MOV BL,[SI]

CMP AL,BL

JC L1

JZ L1

XCHG AL,BL

MOV [SI],BL

L1:

LOOP L2

MOV [DI],AL

INC DI

MOV SI,DI

DEC DL

JNZ L3

ret

Output :-




Comments

Popular Posts

What is Tinkercad ? How to use Tinkercad ?

Interface 4 push button with arduino & do following: ** SW1 : when press, display 0 to 9 on LCD ** SW2 : when press, display 00 to 99 on LCD ** SW3 : when press, display 000 to 999 on LCD ** SW4 : when press, display 0000 to 9999 on LCD