;bubble sort N words starting at 1006 ;N at 1004 ; for (i=0; i A[j+1]) ; swap(A[j],A[j+1]) JMP Start DB 0 ;dummy byte for word alignment DW 6 ;size of data "array" that follows DW 44 DW 12 DW 22 DW 4 DW 41 DW 6 Start: MOV BX,[1004] ;get N ;i loop N-1 times NextI: MOV SI,1006 ;first word of array MOV CX,BX ;j=i ? NextJ: ;bubble largest to end MOV DX,[SI] CMP DX,[SI+2] ;compare A[j] with A[j+1] JS Else ;if DX