Hello all, I have this irritanting calculation which I must do on my PIC16F877, and I'm using CCS PIC C (PCM). Trouble is, this calculation alone takes up 4% of my code space, and I want it reduced. Unfortunately, my PIC asm isn't too good and I don't really know where to begin. I was hoping some of you might be able to help. The calculation includes a few calibration values (end on -Cal) and have to do with some timing intervals. y = (T1 - ((ZCal * T2) / T2Cal) / T2Cal; In itself, no real shocking formula. Point is, T1, ZCal, T2 and T2Cal are unsigned longs (int16), so their product is an int32. Result y is a float. As you can see, the compiler generates an incredible lot of code to handle all the int32, int16 and float stuff. So my question is: does anyone know how to handle this more efficiently? I've been trying to rewrite the equation but it doesn't seem to get any better. Thanks a lot! Martijn PS. Yes, this is a repost, but I'm still stuck with the problem. Sorry. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu