POINTR is the pointer variable that is used to point at successive elements of the array. Though it would have been more natural to use something like array[i], the approach of using pointers is quite natural in C. POINTR is put at location 1000 in memory to tie it into the diagrams in Section 8.5. Likewise, the array occupies words 2500 through 2504 and the sum is in location 1500. The equals directive is an assembler command that tells the assembler to write the code so that these values are placed at the desired locations. POINTR is set to point at the first word of the array by actually loading that address, 2500, and storing it into the pointer. C allows this to be done more easily without knowing exactly what the number is, by using the address-of operator, as in pointr = &array[0]; Recall that an array is addressed by its first element (or the first byte of the first element). There is really no other way to address a large chunk of memory in machine language. |