Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. subroutine (10 pts) [MSP430 Microcontroller Basics, section 4.6] a. When a subroutine is called, what happens to the stack? b. What would happen if
4. subroutine (10 pts) [MSP430 Microcontroller Basics, section 4.6] 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 #1, R10 #4215h,R8; #38A6h,R9; mov.W data data 1 2 push.w R8 push. R9 call pop.w pop.w #subroutine R9 R8 ending subroutine: ; subroutine adds value in R10 to data values on stack add.W R10,2(SP add.w 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