PIC 18F family.
Three registers ACC_U, ACC_H, ACC_L
To multiply the 16-bit value stored in ACC_H, ACC_L by 128, I am currently repeating the snipet below, 7 times
which, no surprise, takes 28 lines of code.
Do you know of any trick to do it faster?
Three registers ACC_U, ACC_H, ACC_L
To multiply the 16-bit value stored in ACC_H, ACC_L by 128, I am currently repeating the snipet below, 7 times
Code:
BCF STATUS,C ;ensure that LSB will get a 0 into b0
RLCF ACC_L,F ;rotate to left and retain new value.
RLCF ACC_H,F ;rotate to left and retain new value.
RLCF ACC_U,F ;rotate to left and retain new value.
which, no surprise, takes 28 lines of code.
Do you know of any trick to do it faster?