Function disassemble function sum disassemble

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: ) { up->__________ = *(up->__________) - up->__________; } A. What would be the offsets (in bytes) of the following fields: e1.p: e1.y: e2.x: e2.next: B. How many total bytes would the structure require? C. The compiler generates the following assembly code for the body of proc: 1 2 3 4 5 6 7 8 movl movl movl movl movl movl subl movl 8(%ebp),%eax 4(%eax),%edx (%edx),%ecx %ebp,%esp (%eax),%eax (%ecx),%ecx %eax,%ecx %ecx,4(%edx) Based on this, fill in the missing expressions in the code for proc. [Hint: Some union references can have ambiguous interpretations. These ambiguities get resolved as you see where the references lead. There is only one answer that does not perform any casting and does not violate any type constraints.] 160 CHAPTER 3. MACHINE-LEVEL REPRESENTATION OF C PROGRAMS 3.10 Alignment Many computer systems place restrictions on the allowable addresses for the primitive data types, requiring that the address for some type of object must be a multiple of some value (typically 2, 4, or 8). Such alignment restrictions simplify the design of the hardwa...
View Full Document

Ask a homework question - tutors are online