Question: For each of the following complex operations, write a sequence of PIC 16F1829 instructions thatperforms an equivalent operation. Assume that X, Y, and Z are
For each of the following complex operations, write a sequence of PIC 16F1829 instructions thatperforms an equivalent operation. Assume that X, Y, and Z are 16-bit values split into individualbytes as shown in the following cblock directive, which defines two additional variables you canuse:
cblock 0x70
XH, XL ; High and low bytes of X
YH, YL ; High and low bytes of Y
ZH, ZL ; High and low bytes of Z
TEMP ; Temporary byte, if needed
COUNT ; Loop counter, if needed
Endc
1. Given an 8-bit variable, YL, perform the multiplication:
YL = YL * 10
Hint: Note that multiplication by a constant amount can be broken into a series of shift and addoperations. For example, in general:
X * 2 can be implemented by shifting X to the left by 1 (X << 1)
X * 5 can be implemented as (X * 4) + X = (X << 2) + X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
