Optional material: advanced address mode for accessing array elements

  • Offset used to access the array element A[i]:

      offset = 1*i    if A is a  byte typed array
    
      offset = 2*i    if A is a short typed array
    
      offset = 4*i    if A is an  int typed array
    

  • Recall that:

         x  <<  12 * x 
         x  <<  24 * x 
    

    Examples:

              x                  x << 1               x << 2 
         ----------------------------------------------------------
          00000011 (= 3)     00000110 (= 2*3)    00001100 (= 4*3)