Question: : cmp.b 3.(25 points) Analyze assembly program Consider the following code segment. .data mystr: .cstring CPE325-Lab! .text Assemble into program memory. RESET: mov.W #__STACK_END, SP

 : cmp.b 3.(25 points) Analyze assembly program Consider the following code

: cmp.b 3.(25 points) Analyze assembly program Consider the following code segment. .data mystr: .cstring "CPE325-Lab!" .text Assemble into program memory. RESET: mov.W #__STACK_END, SP ; Initialize stackpointer StopWDT: mov.W #WDTPW/WD THOLD,&WDTCTL Stop watchdog timer mov.W #mystr, R4 gnext: mov.b @R4, RS #e, R5 jz lend cmp.b #'A', R5 j1 Inext cmp.b #'Z'+1, RS j1 lcony jmp lcopy Iconv: sub.b #'A', RS add.b #'a', RS lcopy: mov.b R5, 0(R4) Inext: inc.w R4 jmp gnext lend: nop jm $ jump to current location 'S' (endless loop) A. (20 points) What does this program do? Add code comments. B. (5 points) Calculate the total execution time in seconds (before reaching the infinite loop at the end of the program). 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!