arrays - assembly program to sort in special way? help please? -
8086 assembly language program sorts array follows: smallest value in array should placed in first cell. second smallest value in last cell. third smallest value in second cell of array. fourth smallest value placed in before-last cell of array. • above procedure continues until array sorted. note in above-described sorting technique, large values in initial array end being placed @ middle part of array here code sorting in normal way : org 100h .model small .data table db 9,2,6,8,5,1 b db 6 dup(0) val1 db 5 nl db ' ','$' .code mov ax,@data mov ds,ax lea bx,table mov dl,val1 lbl1: lea bx,table mov cl,5 lbl2: mov al,[bx] mov dl,[bx+1] cmp al,dl jb lbl3 mov [bx],dl mov [bx+1],al lbl3: ...