Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

: 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

image text in transcribed
: 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

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

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

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Explain the nature of human resource management.

Answered: 1 week ago