Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt AI 1 0 9 0 . .

Answered: 1 week ago

Question

At what level(s) was this OD intervention scoped?

Answered: 1 week ago