Write an x86 MASM assembly program to find the smallest element by searching an
ID: 3605721 • Letter: W
Question
Write an x86 MASM assembly program to find the smallest element by searching an array
int ary[[ ] = { 1 1 , 1 5,, - 3,, - 4,, 0,, 6 0 ,111,, - 1 ,118 }
int i ndex = 0 ;
int max = ary[[00]] ;
int arraySize = sizeof array / sizeof max
while ( index < arraySize )
{
if (aary[[iindex]] < min )
min = ary[[iindex]];;
}
Use cmp Instruction and the appropriate jump instruction (signed or unsigned) to translate the if and while statements
Use $ operator to calculate the size of the array, and inc instruction to increment the index of the array
Explanation / Answer
Ans:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.