Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

3. (25 points) Analyze assembly program Consider the following code segment. mystr : .cstring 325Lab. data .text Assemble into program memory - ; Initialize stackpointer

image text in transcribed
3. (25 points) Analyze assembly program Consider the following code segment. mystr : .cstring "325Lab. data .text Assemble into program memory - ; Initialize stackpointer #-STACK END, SP #NDTPWINDTHOLD, &MDTCTL #mystr, R4 RESET: mov.w mov.w mov.w StopiDT: ; Stop watchdog timer gnext: mov.b RA, R5 #0, RS lend cmp.b jz .b j1 #'a", lnext RS lconv j1 jmp icopy sub.b add.b #'a", #'A', RS RS Iconv : lcopy: mov.b R5, 0(R4) lnext: inc.w R4 jmp gnext nop jmp s lend: ; jump to current location ' (endless loop) A. (20 points) What does this program do? Add code comments. B. (5 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 infinite loop)? 3. (25 points) Analyze assembly program Consider the following code segment. mystr : .cstring "325Lab. data .text Assemble into program memory - ; Initialize stackpointer #-STACK END, SP #NDTPWINDTHOLD, &MDTCTL #mystr, R4 RESET: mov.w mov.w mov.w StopiDT: ; Stop watchdog timer gnext: mov.b RA, R5 #0, RS lend cmp.b jz .b j1 #'a", lnext RS lconv j1 jmp icopy sub.b add.b #'a", #'A', RS RS Iconv : lcopy: mov.b R5, 0(R4) lnext: inc.w R4 jmp gnext nop jmp s lend: ; jump to current location ' (endless loop) A. (20 points) What does this program do? Add code comments. B. (5 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 infinite loop)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions