i have problem in this code it work well in 1st loop then its bug as si and di still the same and making alot of jumps without any change
this code sorting descending
jmp strXt0
arr dw 0x1,0x9,0x3,0x2,0x7,0x3,0x6,0x4,0x9,0x5
arr_e equ $
strXt0:
mov si, arr
mov di, arr+2
mov cx, 0
srto_l:
mov al, [si]
cmp al, [di]
jg swap
srto_retrnx:
add [si], 2
add [di], 2
cmp [di], arr_e
jz prgnmxexit
jmp strXt0
swap:
xchg al, [di]
mov [si], al
mov al, [si+1]
xchg al, [di+1]
mov [si+1], al
inc cx
jmp srto_retrnx
prgnmxexit:
or cx, cx
jz done
jmp strXt0
done:
so any 1 can help me whats the error?