Question: Please use x86 Assembly Language (use 32-bit Visual Studio) 1.(5 points) Write an assembly program to find the smallest element by searching an array int

Please use x86 Assembly Language (use 32-bit Visual Studio)

1.(5 points) Write an assembly program to find the smallest element by searching an array

int ary[] = {11,15,-3,-4, 0, 60,11,-1,18,-4,-6, 9,-20}

int index = 0;

int min = ary[0];

int arraySize = sizeof array / sizeof min

while (index < arraySize) {

if (ary[index] < min)

min = ary[index];

}

- Do not use loop instruction.

Make sure you understand what int represent in C and assembly language.

- Also, make sure that variables declared and defined in C has to be in the .data section in assembly

- Use cmp instruction and the appropriate jump instruction (signed or unsigned) to translate the if and while statements.

- Use $ operator (see chapter 3) to calculate the size of the array.

- Run your program using the debugger to verify your answers.

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!