The assembly code for the loop is shown below the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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[12]; char *B[8]; double C[6]; double *D[5]; 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 floating-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

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online