Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

3. (25 points) Analyze assembly program Consider the following code segment. Istr: .string "You will be tested!" 1strf: .text ; Assemble into program memory. RESET: StopWDT: 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 #_STACK_END, SP ; (2) Initialize stackpointer #WDTPWWDTHOLD,&WDTCTL ; (5) Stop watchdog timer #lstr, R4 #Istrf, R10 R19, R11 R4, R11 R11 #-1, R10 @R4+, R5 (R10), -1(R4) R5, (R10) R10 (1) R11 gnext acceeeecco (1) (2 jmp $ ; 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). 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!" 1strf: .text ; Assemble into program memory. RESET: StopWDT: 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 #_STACK_END, SP ; (2) Initialize stackpointer #WDTPWWDTHOLD,&WDTCTL ; (5) Stop watchdog timer #lstr, R4 #Istrf, R10 R19, R11 R4, R11 R11 #-1, R10 @R4+, R5 (R10), -1(R4) R5, (R10) R10 (1) R11 gnext acceeeecco (1) (2 jmp $ ; 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). 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

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions