The approach to arrays taken in this program differs from that in Section 9.6 where an explicit index variable is added to the base address. The base address of the array in the program above is 2500, but instead of adding 1 to it, we actually do pointer arithmetic on the pointer. When pointers are used for linked lists or graphs or other structures than arrays, they must be used as above; the array element notation is not available. But as we saw in Section 9.6, even array[i] gets turned into instructions that use LDS and STS. |