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 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
Get step-by-step solutions from verified subject matter experts
