Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need asap , i will rate good right away! Thank you 3. (25 points) Analyze assembly program Consider the following code segment. 1 RESET: #
Need asap , i will rate good right away! Thank you
3. (25 points) Analyze assembly program Consider the following code segment. 1 RESET: # STACK END , SP ; Initialize stack pointer 2 StopWDT : 4 6 gnext mov . w mov.w #WDTPWIWDTHOLD, &NDTCTL ; Stop watchdog timer sub.w #10, SP mov. SP, R6 mov.b R4+, R5 CTR:h #0, R5 iz lend 10 i1 12 13 il sub . b #'A', R5 add . b #"a', R5 mov.bR5, 0 (R6) inc.w R6 17 18 19 lend: 20 loop) 21 myinput: .cstring "CPE325Lab" mov.b R5, 0(R6) jump to current location '(endless A. (12 points) What does this program do? Add code comments (lines 1-19). B. (10 points) Sketch the content of the stack at the moment when the program executes the instruction at line 20. Assume that the original value of R1-0x0600 (initialized in line 1) ascii('A')-0x41, ascii('Z')-0x5A, ascii('0')-0x30. Address M[15..8] M[7..0] 0x0600 C. (3 points) Calculate the total execution time in seconds (time it takes for the program to reach statement in line 20). Assume the clock frequency is 8 MHz. How many instructions are executed in this program (before reaching the statement at line 20)? 3. (25 points) Analyze assembly program Consider the following code segment. 1 RESET: # STACK END , SP ; Initialize stack pointer 2 StopWDT : 4 6 gnext mov . w mov.w #WDTPWIWDTHOLD, &NDTCTL ; Stop watchdog timer sub.w #10, SP mov. SP, R6 mov.b R4+, R5 CTR:h #0, R5 iz lend 10 i1 12 13 il sub . b #'A', R5 add . b #"a', R5 mov.bR5, 0 (R6) inc.w R6 17 18 19 lend: 20 loop) 21 myinput: .cstring "CPE325Lab" mov.b R5, 0(R6) jump to current location '(endless A. (12 points) What does this program do? Add code comments (lines 1-19). B. (10 points) Sketch the content of the stack at the moment when the program executes the instruction at line 20. Assume that the original value of R1-0x0600 (initialized in line 1) ascii('A')-0x41, ascii('Z')-0x5A, ascii('0')-0x30. Address M[15..8] M[7..0] 0x0600 C. (3 points) Calculate the total execution time in seconds (time it takes for the program to reach statement in line 20). Assume the clock frequency is 8 MHz. How many instructions are executed in this program (before reaching the statement at line 20)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