Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Recall that the stack of the ARM Cortex M0+ processor is descending full. For the FRDM KL25Z board, the initial value of the stack pointer
Recall that the stack of the ARM Cortex M0+ processor is descending full. For the FRDM KL25Z board, the initial value of the stack pointer is SP = 0x1FFFF100. Consider the code below and answer the following questions: fill up the columns of the special-purpose registers PC, LR, and SP after each instruction is executed. What is the content of RO at the completion of the code? Label Instruction Instruction Address Program Link Stack Pointer Counter Register (SP) (PC) (LR) Ox118 / 0x0C70x1FFFF100 START LDR R2, =G LDR RO, [R2] BL QUAD B DONE 5 QUAD PUSH {LR BL SQ 7 BL SO POP (PC sQ MULS RO, RO 10 BXLR 11 DONE NOP Ox118 Ox11A 0x11C Ox120 Ox122 Ox124 Ox128 Ox12C Ox12E Ox130 0x132 1. Draw the flowchart of the above code. 2. How many subroutines does the above code have? 3. Assume G = 7. What is the content, in hex and decimal, of RO when the code is executed? 4. What is the content of the link register LR when instruction 3 is executed? 5. What is the content of the program counter PC when instruction 3 is executed? 6. What happens to the stack pointer SP when Instruction 5 is executed? 7. What value is stored on the top of the stack when Instruction 5 is executed? 8. What is the content of the link register LR when Instruction 6 is executed? 9. What is the content of the program counter PC when instruction 6 is executed? 10. What happens to the stack pointer SP when Instruction 8 is executed? 11. What value is popped into the program counter PC when Instruction 8 is executed? 12. Based on your answers above, fill up the Program Counter (PC), Link Register (LR), and Stack Pointer (SP) columns in the above table. Recall that the stack of the ARM Cortex M0+ processor is descending full. For the FRDM KL25Z board, the initial value of the stack pointer is SP = 0x1FFFF100. Consider the code below and answer the following questions: fill up the columns of the special-purpose registers PC, LR, and SP after each instruction is executed. What is the content of RO at the completion of the code? Label Instruction Instruction Address Program Link Stack Pointer Counter Register (SP) (PC) (LR) Ox118 / 0x0C70x1FFFF100 START LDR R2, =G LDR RO, [R2] BL QUAD B DONE 5 QUAD PUSH {LR BL SQ 7 BL SO POP (PC sQ MULS RO, RO 10 BXLR 11 DONE NOP Ox118 Ox11A 0x11C Ox120 Ox122 Ox124 Ox128 Ox12C Ox12E Ox130 0x132 1. Draw the flowchart of the above code. 2. How many subroutines does the above code have? 3. Assume G = 7. What is the content, in hex and decimal, of RO when the code is executed? 4. What is the content of the link register LR when instruction 3 is executed? 5. What is the content of the program counter PC when instruction 3 is executed? 6. What happens to the stack pointer SP when Instruction 5 is executed? 7. What value is stored on the top of the stack when Instruction 5 is executed? 8. What is the content of the link register LR when Instruction 6 is executed? 9. What is the content of the program counter PC when instruction 6 is executed? 10. What happens to the stack pointer SP when Instruction 8 is executed? 11. What value is popped into the program counter PC when Instruction 8 is executed? 12. Based on your answers above, fill up the Program Counter (PC), Link Register (LR), and Stack Pointer (SP) columns in the above table
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