;PROGRAM TO ARRANGE NUMBERS IN DESCENDING ORDER
data segment
list dw 53h,25h,19h,44h,13h,02h
count equ $-list-1
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov dx,5h
again0: mov cx,dx
mov si,offset list
again1: mov ax,[si]
cmp ax,[si+2]
jg pr1
xchg [si+2],ax
xchg [si],ax
pr1:
add si,02h
loop again1
dec dx
jnz again0
int 03h
code ends
end start
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment