Question: HLA PROGRAMMING (high level assembly NOT assembly) This piece of code bubble sorts through a constant array, however I want to change it to a

HLA PROGRAMMING (high level assembly NOT assembly)This piece of code bubble sorts through a constant array, however I want to change it to a selection sort. This is in hla (high level assembly language) NOT assembly language please be sure to write in the correct language and leave comments so that I understand what you are doing. Thank you!

while(swapped) do mov(false, swapped);

for(mov(0, ebx); ebx < numElements - 1; inc(ebx)) do mov(selectArray [ebx*4], eax);

if(eax > selectArray[ebx*4 + 4]) then mov(selectArray [ebx*4 + 4], ecx); mov(ecx, selectArray[ebx*4]); mov(eax, selectArray[ebx*4 + 4]);

mov(true, swapped);

endif;

stdout.puti32Size(selectArray [ebx * 4], 4, ' ');

endfor;

stdout.puti32Size(selectArray[numElements * 4 - 4], 4, ' '); stdout.newln();

endwhile;

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!