Actually, if high three bits aren't valued those can be zeroes. So left shifting through the register can be rewritten as: rlf byteX,W ;000abcde f -> 00abcdef 0 addlw B'11100000' ;a -> carry andlw B'00011111' ;000bcdef movwf byteX ;store updated back Am I clearly think that you going to shift it left through many register ? If so this is what you need probably. James Newton wrote: > > That being the case, I don't understand why the top three bits of byte 2 > need to be excluded. Seems like it would be simpler to just preshift the > data in your table by three bits left and then just load carry on each loop > by shifting it once more to the left to be setup for (Oliver or Demitry's) Hmm.. James you know that nobody before has changed my name in such way ;) Sound close to Demetriy ;) (Actually my name has came from greek language I guess) WBR Dmitry. > rlf byte1,W ;get new bit from carry > > xorwf byte1,W ;get difference > andlw B'00011111' ;0's will mask unchanged bits > xorwf byte1,F ;update only required bits > > or was that what you ment when you said, "byte 2 is just for my example"? -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu