IVP wrote: > If Result > 32767 then Result =3D 32767 > > If Result < -32768 then Result =3D -32768 > > It would help if I could get an idea of how more-negative works > past 16 bits. You can figure this stuff out by looking at the combination of the carry, overflow, and sign bits. Fortunately, there are instruction with nice mnemonics that do exactly that already. These are the conditional branches= .. For example, BRA LT takes the branch after A-B if A was less than B. You have to know whether you're working with signed or unsigned integers. The equivalent for unsigned is BRA LTU. Note also that you don't have to do a subtract. There are compare instructions that do the same arithmetic as a subtract but don't store the result anywhere. See the table of BRA instruction in Table 3-8 on page 3-9 of the programmer's reference manual. My version is DS70030E and may be a bit old by now, so your page may be a little different. I usually keep the book open to this chapter when writing dsPIC code. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .