Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a. When a subroutine is called, what happens to the stack? b. What would happen if a subroutine changes the top value of the
a. When a subroutine is called, what happens to the stack? b. What would happen if a subroutine changes the top value of the stack? c. What instruction enters a subroutine? d. What instruction returns from a subroutine? e. How do you pass parameters to a subroutine? .text mov.w #1, R10 mov.w # 4215h, R8; data 1 mov.w #38A6h, R9; data 2 push.w R8 push.w R9 call #subroutine pop.w R9 pop.w R8 jmp ending subroutine: ; subroutine adds value in R10 to data values on stack add.w add.w R10,2(SP) R10,4(SP) ret ending: jmp ; infinite loop to end program f. In this program, why are 2(SP) and 4(SP) used to address the values on the stack? g. In this program, how were parameters passed to the subroutine?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started