Question
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,6,2,6,4}; int lower = 2; int upper = 7 ; int ArraySize int index = 0; int sum = 0; = sizeof array / sizeof lower; while index = lower && array[index] <= upper ) { { sum += array[index]; index++; } } Your assembly language program must also display as output: 1. the number of times a member of 'array' qualified for inclusion into the 'sum' and 2. what the final value of the variable 'sum' was. (Hint: you may have to add another variable.) Feel free to use the author's procedures in the book's link library. Use only the procedures that were introduced in chapter 5.
Question image 1