<<
What I have is an input that reads '11010000' say. What I need to do is
convert it to '00001101' say.

One route seems to be to RRNCF four times. Would this do the job and not
affect any other registers?
>>
Philip thats ok if you are using 17cxx devices but the instruction dosent
exist on 12,16cxxx devices consequently first preserve carry if required then
rrf four times will get to the same place

Sounds like it should work u dont need to save carry during manipulation as it
is used but appears in bit 4 however the upperbits are not in the corect place
but this is only important if they are needed.

Sorry all the above is bollox

SWAPF ANYREG,F ; does exactly what you want in a single instruction
without affeactin any status bits.............

> I have a question about bit manipulation.
> What I have is an input that reads '11010000' say. What I need to do is
> convert it to '00001101' say.
>
> One route seems to be to RRNCF four times. Would this do the job and not
> affect any other registers?
>
> Is there a better way to bit mask to create the desired result?

I would think that the SWAPF instruction would work nicely if your
example of a four bit shift is representative. Adding an XORFW with a
mask of 0xF0 will get rid of the high order bits if their not needed.

Steve

Philip Martin wrote:
>
> What I have is an input that reads '11010000' say. What I need to do
> is convert it to '00001101' say.
>
> One route seems to be to RRNCF four times. Would this do the job and
> not affect any other registers?