Question: 5._ (20 points) A recursive function int factorial (int n)i A recursive assembly code int main(void) AREA main, CODE, READONLY EXPORT-main factorial(3); return 8 ENTRY
5._ (20 points) A recursive function int factorial (int n)i A recursive assembly code int main(void) AREA main, CODE, READONLY EXPORT-main factorial(3); return 8 ENTRY main PROC stop stop factorial int factorial(int n)exe880013e factorial BL int fi if(n 1) else exe8008134 s ENDP return 1; PUSH (r4, 1r) MOV r4, re OP r4,#8x01 BNE NZ HOVS re, #ex81 | exeseee136 f " n*factorial (n-1); return f 8x88808138 8x8800013A 8xe80ee13C 8x8888813E ex88ee0148 loop POP (r4, pc 8x88888142 NZ 8x88800144 8x88888148 8x8880014C SUBS re, r4, #1 BL factorial MUL re, r4, re 8 loop END Show the stack content when factorial(I) is returned 8x20080618 8x20080614 0x28808618 0x20000680 0x20000688 ex20000604 8x20000680 8x200005FC 0x200005F8 8x200005F4 ex200005F0 8x200005EC 0x20000SE8 0x200005E4 0x200005E0 8x200005DC 0x200005D8 0x200005D4 0x200005De 0x200005CC 0x200005C8 0x200005C4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
