D our process is active for around 95ms every 200 ms

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: ogram counter into an integer register. B.3. MACHINE LEVEL REPRESENTATION OF C PROGRAMS Problem 3.15 Solution: [Pg. 136] 707 This problem makes concrete the discussion of register usage conventions. Registers %edi, %esi, and %ebx are callee save. The procedure must save them on the stack before altering their values and restore them before returning. The other three registers are caller save. They can be altered without affecting the behavior of the caller. Problem 3.16 Solution: [Pg. 139] Being able to reason about how functions use the stack is a critical part of understanding compiler-generated code. As this example illustrates, the compiler allocates a significant amount of space that never gets used. A. We started with %esp having value 0x800040. Line 2 decrements this by 4, giving 0x80003C, and this becomes the new value of %ebp. B. We can see how the two leal instructions compute the arguments to pass to scanf. Since arguments are pushed in reverse order, we can see that x is at offset relative to %ebp and y is at offset . The add...
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