I have done the similar project in the past too. I have converted Bubble sort and Selection Sort algorithms recently. It was done using masm32 in visual studio. As a sample work, given below is the converted code for selection sort:
***Selection Sort’s Code in Java***
int first,temp;
for (int i= array.length-1;i>0;i--){
first = 0;
for (int j=1;j<=i;j++){
if(array[j] > array[first])
first = j;
}
temp= array[first];
array[first] = array[i];
array[i] = temp;
}
***Selection Sort in Assembly***
.386
.model flat, stdcall
.stack 4096
.data
array byte 101, 23, 3, 78, 43, 7 , 87 , 54, 75 , 45, 87, 76
ExitProcess proto,dwExitCode:dword
.code
main proc
mov ecx, lengthof array ; ecx = 12
cmp ecx,1
je Gotoend
dec ecx ; ecx = 11
OuterLoop:
push ecx
mov ebx,0 ; ebx = first
mov esi, 1 ; esi = j
InnerLoop:
mov dl, array[ebx]
cmp dl,array[esi]
jb L1
jmp L2
L1:
mov ebx, esi
L2:
inc esi
Loop InnerLoop
pop ecx
mov dh, array[ebx]
xchg dh, array[ecx]
mov array[ebx],dh
Loop OuterLoop
Gotoend:
invoke ExitProcess,0
main endp
end main