Explain what the command: MOVIW FSR1++ does and the contents of all relevant reg
ID: 3796290 • Letter: E
Question
Explain what the command: MOVIW FSR1++ does and the contents of all relevant registers after execution. Explain with words, as you have no specific numbers. Give an example of a situation when an auto-increment feature would be useful Write an example of the answer you gave above in PIC assembly. What is the number of instruction cycles required to perform the following code, which starts at the label START What is the maximum number of loops which can be attained by modifying the "MOVLW 0 times F" instruction while still having a working program (shown your work). What is the limiting factor? How many seconds would the above code take, after being set to the maximum length found in the second part? Assume that the clock speed on the board is 40 MHz.Explanation / Answer
Question 1: MOVIW instruction have operands which differ in syntax, the given instruction is performing post increment operation on FSR.
Question 2: Suppose you are running a loop and same operation needs to be performed again and again for some iterations then auto increment is useful.
Question 3:
It will take 25 instruction cycles to execute.
Since MOVLW can hold 8-bit value so the maximum value which can be stored in MOVELW is 28-1=255.
So the loop can run maximum of 255 times.
If the loop is running for 255 times then number of instruction cycles only for loop = 256*4 =1024+4=1028
and Execution time = 1024/40*10^6 = 25 micro seconds.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.