Question: 3. (25 points) Analyze assembly program Consider the following code segment. Istr: .string You will be tested! Istrf: .text Assemble into program memory. RESET: StopWDT:

 3. (25 points) Analyze assembly program Consider the following code segment.

3. (25 points) Analyze assembly program Consider the following code segment. Istr: .string "You will be tested!" Istrf: .text Assemble into program memory. RESET: StopWDT: (2) Initialize stackpointer (5) Stop watchdog timer #_STACK_END, SP #WDTPWI WDTHOLD,&WDTCTL #lstr, R4 #lstrf, R10 R19, R11 R4, R11 mov.W mov.W mov.W mov.W mov.W sub.W rra.W add.w mov.b mov.b mov.b dec.W dec.W jnz eeeeee gnext: (6) #-1, R10 @R4+, R5 (R10), -1(R4) R5, (R10) R10 R11 gnext (4); ; ; (1) (1) (2) jmp $ ; 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 (before reaching the infinite loop at the end of the program). The numbers in paranthesis specify the number of clock cycles needed for each instruction to execute. Assume the clock frequency is 2 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. Istr: .string "You will be tested!" Istrf: .text Assemble into program memory. RESET: StopWDT: (2) Initialize stackpointer (5) Stop watchdog timer #_STACK_END, SP #WDTPWI WDTHOLD,&WDTCTL #lstr, R4 #lstrf, R10 R19, R11 R4, R11 mov.W mov.W mov.W mov.W mov.W sub.W rra.W add.w mov.b mov.b mov.b dec.W dec.W jnz eeeeee gnext: (6) #-1, R10 @R4+, R5 (R10), -1(R4) R5, (R10) R10 R11 gnext (4); ; ; (1) (1) (2) jmp $ ; 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 (before reaching the infinite loop at the end of the program). The numbers in paranthesis specify the number of clock cycles needed for each instruction to execute. Assume the clock frequency is 2 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!