Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (25 points) Analyze assembly program Consider the following code segment. 1 RESET: 2 StopWDT : #-STACK-END, SP #kDTPHIWDTHOLD,&MDTCTL Initialize stack pointer Stop mov .w

image text in transcribed
3. (25 points) Analyze assembly program Consider the following code segment. 1 RESET: 2 StopWDT : #-STACK-END, SP #kDTPHIWDTHOLD,&MDTCTL Initialize stack pointer Stop mov .w mov.w sub.w #10, SP mov.W SP, R6 mov.w #myinput, R4 mov.b ER4+, RS cmp . b #0, R5 ; watchdog timer 6 gnext: lend . b jl #"A", lcopy RS 18 12 14 1conv: 15 16 lcopy: 17 18 19 lend: 20 21 myinput: .cstring "CPE325Lab" j1 jmp sub . b add "b mov.b inc.w jmp mov.b jmp conv lcopy #"A", R5 #'a', RS R5,0(R6) R6 gnext RS, e(R6) jump to current location '(endless loop) 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, asciZ)-0x5A, ascii('0)-0x30. Address MI15 MI7.0] 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

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_2

Step: 3

blur-text-image_3

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

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions

Question

What will you do or say to Anthony about this issue?

Answered: 1 week ago