IVP wrote: > if(diff >=3D 0) > byte =3D 0; > else > > { > byte =3D 8; > diff =3D - diff; > } I'm no C whiz (I can just about spell it), but that looks really messed up to me. Hopefully someone that actually knows C will jump in, but doesn't the ";" at the end of the second line end the IF statement? If so, the ELS= E must be part of a outer IF statement not shown? Unfortunately C encourages such messily written code. Yucc. Anyway, assuming 16 bit signed integers and the general case of DIFF and BYTE not being in special (near) memory, the first two lines can be state i= n ASM30 thusly: mov #0, w1 ;get zero ready in case needed mov diff, w0 ;get DIFF btss w0, #15 ;DIFF < 0 ? mov w1, byte ;no, DIFF >=3D 0, clear BYTE to 0 Note that this code snippet trashes W0 and W1. ******************************************************************** 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 .