>I found the real problem. The carry flag is used in the shift routine. What I >found is that during the multitasking the carry flag is getting modified by >other routines. When it returns to the serial routine the wrong carry flag >corrupts the data. How can I prevent this or save the carry flag and restore >it on re-entry to the program? Easy! Don't use the carry flag. Modify your routine so that the shift occurs AFTER you have sent the current bit, then use btfsc / btfss bit 0 ( (if you are shifting right) or bit 7 (shifting left) and ignore C altogether. No extra code and no extra RAM needed. If you think about it, you are doing exactly the same thing with C anyways. Just 'slide' everything over by 1 bit. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (403) 489-3199 voice (403) 487-6397 fax