Function Question

Thread Starter

davis1d0

Joined Mar 24, 2009
4
I'm working with a PIC18F4520. My question is less how to make my code work but a clarification on an instruction.

I wanted to shift my value to the right twice to divide by 4, but the only function I'm finding is the Rotate w/ or w/out carry. This does not seem of offer what I'm looking for as it puts the LSB back in the reg as the MSB.

Can someone tell me if I correct in my understand?

I truly hope that I'm wrong.

Thanks
 

AlexR

Joined Jan 16, 2008
732
You are perfectly correct in your assumptions. The work around it to use the rotate through carry instruction making sure you clear the carry bit before each rotation.
 
Top