Question: (15 points) Consider the following ARM program. Trace the stack activity, including all changes to the stack pointer and to the contents of the stack.

 (15 points) Consider the following ARM program. Trace the stack activity,
including all changes to the stack pointer and to the contents of

(15 points) Consider the following ARM program. Trace the stack activity, including all changes to the stack pointer and to the contents of the stack. Clearly indicate the value of the sp. : int main) f int P 3: int Q =-1; P Func1 (P) ; Funcl (Q): int Funcl (intx) t if (x> 0) x-Times16 (x) + 1; else x -32*x return (x): : int Times16(int x) f x = 16"X; return(x): AREA NESTED SUBROUTINE STACK, CODE, READWRITE ENTRY ADR ADR r4, P r5, Q sp, #0 12 16 20 24 28 32 36 40 done MOV fp,#0x0000C000 LDR ro, [r4] BL STR rl, (r4] LDR ro, (r5] BL STR Funcl Funci rl, [r5) done B 44 Funcl PUSH (fp) #0 48 52 56 CMP PUSHGT {lr) PUSHGT (ro) BLGT Times16 POPGT POPGT r0, 60 64 (rl) 68 72 76 {ir } ADDGT r1, r1 , #1 MOVIE 80 84 POP MOV r1, ro, LSL #5 (fp) pc, lr 88 Times16 POP 7 92 r7, r7, LSL#4 MOV PUSH (r7) MOV AREA NESTEDSUBROUTINESTACK, DATA, READWRITE 96 100 pc, lr - - 104 P 108 0 DCD DCD -1 END

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!