Question: Problem 3. This problem considers the growth of the stack in the execution of a recursive function. Consider the recursive version of the popcount function
Problem 3. This problem considers the growth of the stack in the execution of a recursive function. Consider the recursive version of the "popcount" function (pcount.r()), as described in Lecture L10 (beginning on slide 6). Suppose that function is called with actual parameter Ox00000012, from a point where register Krbx contains 0x0000ffff, and where the address of the next instruction is Oxff160548. Assume the address of the (recursive) call instruction is Oxff1703000, and it is a three-byte instruction. a. Including that original invocation, what is the maximum mmber of frames for pcount.r that will be on the stack as a result? . Draw a diagram showing the contents of the stack at the point of maximum depth of recursion. Include the value of all the items pushed onto the stack for each invocation. Problem 3. This problem considers the growth of the stack in the execution of a recursive function. Consider the recursive version of the "popcount" function (pcount.r()), as described in Lecture L10 (beginning on slide 6). Suppose that function is called with actual parameter Ox00000012, from a point where register Krbx contains 0x0000ffff, and where the address of the next instruction is Oxff160548. Assume the address of the (recursive) call instruction is Oxff1703000, and it is a three-byte instruction. a. Including that original invocation, what is the maximum mmber of frames for pcount.r that will be on the stack as a result? . Draw a diagram showing the contents of the stack at the point of maximum depth of recursion. Include the value of all the items pushed onto the stack for each invocation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
