(replying to myself...) On Dec 29, 2007 11:22 PM, Daniel Serpell wrote: > > Well, I tried in my superopt and you can do it in one ins less, using: > > ; B[012] = A[012] + K[012] , K const. > > movf A0,W > addlw K0 > movwf B0 > > clrf B1,F > rlf B1,W > addlw K1 > addwf A1,W > iorwf B1,F > Of course, the above does not work if K1 == 255, in that case you need to replace the middle segment with one of the shorter versions, like: movf A1,W btfss STATUS,C addlw 255 movwf B1 I think that a macro with all the cases will be better... Daniel. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist