Translate the following C program into NASM. #include int ary[] = {12, 40, -2, 89, 35, -7, 6}; int main() { int sum = 0; int highest = 0; for (int x = 0; x



  1. Translate the following C program into NASM.


#include


int ary[] = {12, 40, -2, 89, 35, -7, 6};


int main()


{


     int sum = 0;


     int highest = 0;


     for (int x = 0; x < 7;="" x++)="">


         if (highest <>


              highest = ary[x];


         sum += ary[x];


     }


     printf("Sum is %d\n", sum);


     printf("Highest value is %d\n", highest);


}


Use indexing (the [ebx+esi] or [ebx+edi] form). You can have several “dw” values on the same line. Use the “loop” command.



Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here