On Sat, 30 Mar 2002, Giorgio De Nunzio wrote: > Hi all! > >From time to time this kind of questions are back... > I need a good 24 bit Square root (binary restoring) routine for the 16f84. > I have seen the one at > http://www.piclist.com/techref/microchip/math/sqrt/sqrt24.htm but it is > for the 17c43 and contains an instruction I am not understanding: movfp. > The other instructions are easily understandable even if I do not know the > 17c43. > Can someone help, with a specific 16f84 routine or simply by explaining to > me what that instructions is used for, so that I can translate it in 16f84 > language? Andy David (the author of the routine to which you refer), based his algorithm on the 16-bit routine I wrote for the midrange family: http://www.dattalo.com/technical/software/pic/picsqrt.html You can get some idea on the general algorithm here: http://www.dattalo.com/technical/theory/sqrt.html I'd like to say that extending the 16-bit routine to 24 bits is straight forward. Unfortunately, I don't like to lie. If I extended it, I'd probably go to 32-bits and optimize when needed for 24-bits. Oh, and of no use to you..., I finally linked in my 18cxxx 16-bit square root routine: http://www.dattalo.com/technical/software/pic/sqrt18.asm It had been sitting on the server collecting dust. Scott -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body