.MODEL SMALL
.STACK 100
.DATA
NUM DW 0102H, 0154H, 0070H, 0005H
.CODE
mov ax, @data
mov ds, ax
mov dx, 2
loop2: mov cx, dx
dec cx
mov si, cx
add si, si
mov ax, num[si]
loop1: cmp num[si-2], ax
jae next
mov di, num[si-2]
mov num[si], di
dec si
dec si
dec cx
jnz loop1
next: mov num[si], ax
inc dx
cmp dx, 4
jbe loop2
mov si, offset num
mov dh, 4
mov ch, 04h
l3: mov ax, num[si]
inc si
inc si
dec ch
jnz l3
mov ah, 4ch
int 3h
end