This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e beginning of the array. The value of this pointer will be ÜA . The array elements can be accessed using an integer index ranging between ¼ and Æ ½. Array element will be stored at address ÜA · Ä ¡ . As examples, consider the following declarations:
char A; char *B; double C; double *D; These declarations will generate arrays with the following parameters: Array A B C D Element Size 1 4 8 4 Total Size 12 32 48 20 Start Address ÜA ÜB ÜC ÜD Element ÜA · ÜB · ÜC · ÜD · Array A consists of 12 single-byte (char) elements. Array C consists of 6 double-precision ﬂoating-point values, each requiring 8 bytes. B and D are both arrays of pointers, and hence the array elements are 4 bytes each. The memory referencing instructions of IA32 are designed to simplify array access. For example, suppose E is an array of int’s, and we wish to compute E[i] where the address of E is stored in register %edx and i is stored in register %ecx. Then the instruction:
movl (%edx,%ecx,4),%eax will perform the address computatio...
View Full Document