Question: A recursive function A recursive assembly code int factorial(int n) int main(void) AREA main, CODE, READONLY EXPORT in factorial(3) return e: main PROC int factorial(int

 A recursive function A recursive assembly code int factorial(int n) int

A recursive function A recursive assembly code int factorial(int n) int main(void) AREA main, CODE, READONLY EXPORT in factorial(3) return e: main PROC int factorial(int n) ( BL B factorial stop exe8ee0134 stop int fi if(n 1) return 1 factorial PUSH (r4, 1r) f n'factorial(n-1) xe8ee8136 return f ex88e00138 BNE NZ ex88e0813C 8xe8ee013E ex88800148 loop POP (r4, pc) exe8eee142 NZ 0x88008144 8x88800148 ex88ee014C SUBS re, r4, #1 BL factorial MUL re, r4, re Show the stack content when factorial(1) is returned 0x20000618 8x28008614 0x200006eC 0x20000688 8x20000684 0x20000600 8x200005FC 8x280005F8 ex288005F4 0x200005EC 0x200005E8 0x200005E4 0x200085E0 8x200005DC 8x26000508 8x200005D4 0x200005D 8x200005cc 8x200085C8 8x200005C4

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!