Thus it is good to understand the minimum block sizes

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: ys, we start by annotating the assembly code. In our annotations, we show multiple possible interpretations for some of the instructions, and then indicate which interpretation later gets discarded. For example, line 2 could be interpreted as either getting element e1.y or e2.next. In line 3, we see that the value gets used in an indirect memory reference, for which only the second interpretation of line 2 is possible. 1 2 3 4 5 6 7 movl movl movl movl movl subl movl 8(%ebp),%eax 4(%eax),%edx (%edx),%ecx (%eax),%eax (%ecx),%ecx %eax,%ecx %ecx,4(%edx) Get up up->e1.y (no) or up->e2.next up->e2.next->e1.p or up->e2.next->e2.x (no) up->e1.p (no) or up->e2.x *(up->e2.next->e1.p) *(up->e2.next->e1.p) - up->e2.x Store in up->e2.next->e1.y B.3. MACHINE LEVEL REPRESENTATION OF C PROGRAMS From this, we can generate C code as follows: void proc (union ele *up) { up->e2.next->e1.y = *(up->e2.next->e1.p) - up->e2.x; } 711 Problem 3.23 Solution: [Pg....
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