> Disassembly of the non-working code (with comments I've now added). > 0xc0 and 0xbf are the upper and lower bytes of S2 resp. Why are you using a 16-bit variable instead of an 8-bit (unsigned) variable= ? The subwfb instruction is correct - you do want to subtract the borrow from the most significant byte calculation. What is confusing me is the MOVLW 0xff. If I were writing this in assembly, I would use MOVLW 0x00. -Scott --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .