Tony, I hate to do this to you, but here is simpler(?) way to round to nearest 5: Given 25 bit number HI:MID:LO Its value is LO + 256*MID + 65536*HI Which is equal to LO+255*MID+MID+65535*HI+HI But 255*MID and 65535*HI are both multiples of 5, so: LO+MID+HI == HI:MID:LO (mod 5) This can be at most a 10 bit number, let us call it H2:L2 now we can: movf L2,W,A andlw 0x0F movwf ONES,A swapf L2,W,A andlw 0x0F btfsc L2,4 addlw 5 ; worth 6, not 1 btfsc H2,0 addlw 6 btfsc H2,1 addlw 2 and Bob's your uncle! Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu