Question: For each of the following complex operations, write a sequence of PIC 16F1829 instructions not C codethat performs an equivalent operation 4 (continued Remember, you

 For each of the following complex operations, write a sequence of

For each of the following complex operations, write a sequence of PIC 16F1829 instructions not C codethat performs an equivalent operation

4 (continued Remember, you can assume that 8-bit variables TEMP" and "COUNT" have been defined for cases where you may need extra variables. b. You have a 16-bit variable, X, and an 8-bit variable, P. You can access individual bytes within X-the low byte, XL, holds bit positions 0 to 7, and the high byte, XH, holds bit positions 8 to 15. Write a sequence of instructions that sets P equal to the highest bit position within X that contains a 1, (This operation is similar to the x86 BSR instruction). If X # 0, P should be unchanged. For example: [fX = 0x6 ??? = 0110 000 1 1 010 101 12, P = 14 (underlined bit is "highest" 1) . If X = 0x0082 = 0000 0000 1000 00 102, P = 7 Your solution should not change XL or XH. 10? 4 (continued Remember, you can assume that 8-bit variables TEMP" and "COUNT" have been defined for cases where you may need extra variables. b. You have a 16-bit variable, X, and an 8-bit variable, P. You can access individual bytes within X-the low byte, XL, holds bit positions 0 to 7, and the high byte, XH, holds bit positions 8 to 15. Write a sequence of instructions that sets P equal to the highest bit position within X that contains a 1, (This operation is similar to the x86 BSR instruction). If X # 0, P should be unchanged. For example: [fX = 0x6 ??? = 0110 000 1 1 010 101 12, P = 14 (underlined bit is "highest" 1) . If X = 0x0082 = 0000 0000 1000 00 102, P = 7 Your solution should not change XL or XH. 10

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!