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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started