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 ?

Develop an interfacing circuit and a sketch to increment count on 7-Segment based on switch press. Count goes from 00 to 99.

Identify bugs and resolve it to fulfill following objective. Interface 3 LEDs and 4 SWICHES with Arduino. Develop a program that by pressing 1st switch it will ON LED1, by pressing 2nd switch it ON LED2 and same for 3rd switch and LED3. By pressing 4th switch it will reset (OFF) all LEDs.