Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

global start start: sp. #0x1000 // initialize sp mov mov bl SVC #2 , rsum #999 rsum: sub str str // A: record state of

image text in transcribed

global start start: sp. #0x1000 // initialize sp mov mov bl SVC #2 , rsum #999 rsum: sub str str // A: record state of the stack cbz sp, sp. #16 // reserve space for x30 and x19 x30, sp] x19. [sp. #8] // save temp register // save link register mov sub bl add // e is n, return if e =. // copy n to w19 // recursive call rsum // add result an copy of n 1: ldr ldr add ret x19, [sp. #8] x30, [sp] sp. Sp. #16 restore x19 // restore link register // release stack storage // In the above code, rsum, will be called three times before the recursion finishes. Trace the execution of the above program and state the contents of the stack for the requested conditions If w0-2, what is the contents of the stack at point A:? If w0-1, what is the contents of the stack at point A:? lfwS- , what is the contents of the stack at point A: ? global start start: sp. #0x1000 // initialize sp mov mov bl SVC #2 , rsum #999 rsum: sub str str // A: record state of the stack cbz sp, sp. #16 // reserve space for x30 and x19 x30, sp] x19. [sp. #8] // save temp register // save link register mov sub bl add // e is n, return if e =. // copy n to w19 // recursive call rsum // add result an copy of n 1: ldr ldr add ret x19, [sp. #8] x30, [sp] sp. Sp. #16 restore x19 // restore link register // release stack storage // In the above code, rsum, will be called three times before the recursion finishes. Trace the execution of the above program and state the contents of the stack for the requested conditions If w0-2, what is the contents of the stack at point A:? If w0-1, what is the contents of the stack at point A:? lfwS- , what is the contents of the stack at point A

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions