Answered step by step
Verified Expert Solution
Question
1 Approved Answer
If you please solve all the parts. 3) The following code is Example 5-8 in the book. 1. Write your own comments for each line
If you please solve all the parts.
3) The following code is Example 5-8 in the book. 1. Write your own comments for each line 2 Explain the overall operation of the code (3 sentences. How it is doing the job) 3. Assume a sensor connected to RBO to RB7 reads B'0001 0101 1. What should you change in this program? 2. How many times will the loop run? 3. Write a table specifying the affected registers and their values at each step 4. calculate the execution time when it is run on a PIC18 with a 2MHz clock. Comments Cycles needed NUME EQU 0x15 QU EQU 0x20 RMND_L EQU 0x22 RMND_M EQU 0x23 RMND H EQU 0x24 MYNUM EQU OXFD MYDEN EQU D'10 ORG OH MOVLW MYNUM MOVWE NUME MOVLW MYDEN CLRF QU, F D1 INCF QU, F SUBWF NUME BC D 1 ADDWF NUME DECF QU, F MOVFF NUME, RMND_L MOVFF QU, NUME CLRF QU D 2 INCF QU, F SUBWF NUME BCD 2 ADDWF NUME DECF QU, F MOVFF NUME, RMND_M MOVFF QU, RMND_H HERE GOTO HERE END 4) for the above code, create a table with the instruction addresses and assembly code for each instruction 5) Implement the above code in MPLAB. Run it and make sure it gives correct results. Take a screen shot of the windows necessary to show your work (listing, registers affected, program memory, execution time)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started