Unformatted text preview: n ÜE · , read that memory location, and store the result in register %eax. The allowed scaling factors of 1, 2, 4, and 8 cover the sizes of the primitive data types. Practice Problem 3.17:
Consider the following declarations: 144 CHAPTER 3. MACHINE-LEVEL REPRESENTATION OF C PROGRAMS
short S; short *T; short **U; long double V; long double *W; Fill in the following table describing the element size, the total size, and the address of element for each of these arrays. Array S T U V W Element Size Total Size Start Address ÜS ÜT ÜU ÜV ÜW Element 3.8.2 Pointer Arithmetic
C allows arithmetic on pointers, where the computed value is scaled according to the size of the data type referenced by the pointer. That is, if p is a pointer to data of type Ì , and the value of p is Üp , then the expression p+i has value Üp · Ä ¡ where Ä is the size of data type Ì . The unary operators & and * allow the generation and dereferencing of pointers. That is, for an expression Expr denoting some object, &Expr is a pointer giving the address of the obj...
View Full Document