Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Step: 3

blur-text-image

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

What is benchmarking? What are the benefi ts of benchmarking?

Answered: 1 week ago

Question

socialist egalitarianism which resulted in wage levelling;

Answered: 1 week ago

Question

soyuznye (all-Union, controlling enterprises directly from Moscow);

Answered: 1 week ago