Question: Exercise 6.20 Consider Code Example 6.28. For this exercise, assume factorial (n) is called with input argument n=5. (a) What value is in a0 when

 Exercise 6.20 Consider Code Example 6.28. For this exercise, assume factorial

Exercise 6.20 Consider Code Example 6.28. For this exercise, assume factorial (n) is called with input argument n=5. (a) What value is in a0 when factorial returns to the calling function? (b) Suppose you replace the instructions at addresses 08508 and 0852C with nops. Will the program: (1) enter an infinite loop but not crash; (2) crash (cause the stack to grow or shrink beyond the dynamic data segment or the PC to jump to a location outside the program); (3) produce an incorrect value in a0 when the program returns to loop (if so, what value?); or (4) run correctly despite the deleted lines? (c) Repeat part (b) with the following instruction modifications: (1) Replace the instructions at addresses 08504 and 08528 with nops. (2) Replace the instruction at address 08518 with a nop. (3) Replace the instruction at address 08530 with a nop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!