BubbleSortDWord:
;Bubble sort of dword array
; Parameters:
; ESI - array address
; ECX - array length (number of elements)
.mMain:
dec ecx
cmp ecx,0
jl .mEx
push esi
push ecx
mov bl,0
.mOne:
mov eax,[esi]
cmp eax,[esi+4]
jle .mSkipR
mov edx,[esi+4]
mov [esi],edx
mov [esi+4],eax
mov bl,1
.mSkipR:
add esi,4
loop .mOne
pop ecx
pop esi
cmp bl,0
je .mEx
jmp .mMain
.mEx:
ret