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: value, even though the actual format requires only 10 bytes. Array S T U V W Element Size 2 4 4 12 4 Total Size 28 12 24 96 16 Start Address Element ÜS ÜT ÜU ÜV ÜW ÜS · ¾ ÜT · ÜU · ÜV · ½¾ ÜW · Problem 3.18 Solution: [Pg. 145] This problem is a variant of the one shown for integer array E. It is important to understand the difference between a pointer and the object being pointed to. Since data type short requires two bytes, all of the array indices are scaled by a factor of two. Rather than using movl as before, we now use movw. Expression S+1 S[3] &S[i] S[4*i+1] S+i-5 Type short * short short * short short * Value Assembly leal 2(%edx),%eax movw 6(%edx),%ax leal (%edx,%ecx,2),%eax movw 2(%edx,%ecx,8),%ax leal -10(%edx,%ecx,2),%eax Å Å Ñ ÜS · ÜS · ¾ ÜS · ¾ Ñ ÜS · ÜS · ¾ ·¾ ½¼ Problem 3.19 Solution: [Pg. 147] This problem requires you to work through the scaling operations to determine the address computations, and to apply the formula for row-major indexing. The first step is to annotate the as...
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