Implement the following C++ code fragment in assembly language. Use the block-structured .IF and .WHILE directives. Assume that all variables are 32-bit integers. int array[] = {3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4}; int lower = 3; int upper = 8; int ArraySize = sizeof array / sizeof lower; int index = 0; int sum = 0; while( index < ArraySize ) { if( array[index] >= lower && array[index] <= upper ) { sum += array[index]; } index++; } Your assembly language program must also display as output the number of times a member of ' array ' qualified for inclusion into the ' sum ' and what the final value of the variable ' sum ' was.
Question P
Implement the following C++ code fragment in assembly language. Use the block-structured .IF and .WHILE directives. Assume that all variables are 32-bit integers.
int array[] = {3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4};
int lower = 3;
int upper = 8;
int ArraySize = sizeof array / sizeof lower;
int index = 0;
int sum = 0;
while( index < ArraySize )
{
if( array[index] >= lower && array[index] <= upper )
{
sum += array[index];
}
index++;
}
Your assembly language program must also display as output the number of times a member of ' array ' qualified for inclusion into the ' sum ' and what the final value of the variable ' sum ' was.
( Full explain this question and text typing work only
We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line )
Trending now
This is a popular solution!
Step by step
Solved in 3 steps