I wrote some code for bubble sort in c++. Now I want to write it in flat assembler but it seems harder than I expected. Can someone help or provide relevant sources? Here is my c++ code:
int[] arr= {5,8,7,4,1,9}
int n =6 //array size
for (i = 0; i < n-1; i++){
// Last i elements are already in place
for (j = 0; j < n-i-1; j++){
if (arr[j] > arr[j+1]){
int x=arr[j];
arr[j] = arra[j+1];
arr[j+1] = x
}
}
}
For (int i=0; I < n ;i++){
Cout << “ ”+arr[i]+ “ ” ;
}