How far have you reached and where are you stuck ??
Show us some code and we will help you advance. We can't do the whole thing for you.
Well, to help you get started, here is a MASM code sort an array of len
bs proc array:DWORD,len:DWORD
mov eax,DWORD PTR [edx+ebp*4+4]
cmp DWORD PTR [edx+ebp*4],eax
xchg eax,DWORD PTR [edx+ebp*4]
mov DWORD PTR [edx+ebp*4+4],eax