I'm using unsigned int... 16bit unsigned. Quoting Scott : >> 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) variab= le? > > 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 > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .