Exercise 5            Name       _____________________    Points ___/15

Translate the following from C++ fragments to corresponding structured Assembler. Assume that i and j are defined as dwords. Use WriteDec and ReadDec for input and output.

1. (5)   if (i < eAx) {
            eAx++;
            cout << eAx;
          }
          else {
            eAx--;
            cout << eAx;
          }

 
   

 


 
 

2. (5)    for (i=0; i<10; i++)
            for (j=10; j>5; j--) {
                eAx = i*j;
                cout << eAx;
            }

 
 

 

 
 
 
 
 

3. (5)   int A[] = {15, 14, 9, 3, -1};
         i = 0;
          while (A[i] > 0){
            A[i] = A[i]/3;
            i++;

          }