Here's a 10 line assembler program for extracting square roots that I found at www3.igalaxy.net/~jackt/downloads.htm I don't know if this matches regular practice for square root extraction with PIC. It's for an AVR but is so simple that it's probably understandable even if you've never used an AVR. The routine has the advantage of only requiring 9 lines of assembler and only using add/subtract and the disadvantage of taking sqrt(N) loops to run. For large N some easy reductions in run time could be gained at the cost of more code. Algorithm: "Take successively increasing odd numbers from N until N <= 0. The number of subtractions is the square root" OR Number = N ; Number to take square root of SQRT = 0 K=1 Do While Number > 0 Number = number - K SQRT = SQRT + 1 K = K + 2 End Do I haven't checked that this summary algorithm matches the boundary conditions for the code - It may be 1 cycle out - check the code yourself to be sure. Russell McMahon Attachment - 947 bytes - plain text Content-Type: application/octet-stream; name="avrsqr~1.asm" Content-Disposition: attachment; filename="avrsqr~1.asm" Attachment converted: wonderland:avrsqr~1.asm (????/----) (0000A0A9)