Question: / / translate this code to assembly and once translated copy in the / / asm file as assembly code and the program must run

//translate this code to assembly and once translated copy in the
//asm file as assembly code and the program must run
// Assume arr and N declared and initialized
int i, j, k; -----.data
i: .word 0
j: .word 0
k: .word 0
.text
main:
for (int j =0; j < N-1; j++)
{
int i = j;
for (int k = j+1; k < N; k++){
if (arr[i]>= arr[k]){
i = k;
}
}
int tmp = arr[i];
arr[i]= arr[j];
arr[j]= tmp;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!