Computing.Net > Forums > Programming > Square root in assembly

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Square root in assembly

Reply to Message Icon

Name: Alirezan1
Date: January 16, 2005 at 02:51:54 Pacific
OS: MDK Linux 10.1
CPU/Ram: AMD
Comment:

Hello,

How can I find a square root of a number in 1/256 decimal point percision?
How can I write a subroutine that does that in assembly?

thanks

Alireza

Alireza

Alireza@arnit.net



Sponsored Link
Ads by Google

Response Number 1
Name: bamakhrama
Date: January 16, 2005 at 03:33:58 Pacific
Reply:

Hi,
there are 2 ways:
1) Either the microprocessor has an instruction in its instruction set which performs that operation. (I think Pentium has an instruction like SQRT).
2) If the operation is not supported in H/W, then you should implement any numerical algorithm to find the square root of a number.

--
mohameda@ieee.org


0

Response Number 2
Name: Mechanix2Go
Date: January 16, 2005 at 03:43:24 Pacific
Reply:

No point reinventing the wheel. There must be hundreds of asm code scraps out there.

Try Siomtel.

M2


0

Response Number 3
Name: Mssux
Date: January 16, 2005 at 05:13:56 Pacific
Reply:

is all about the C++ arrays

There is no place like 127.0.0.1


0

Response Number 4
Name: BlueRaja
Date: January 16, 2005 at 11:27:11 Pacific
Reply:

You could always just compile the sqrt() function and take a look at the code generated..

BlueRaja.admin@gmail.com


0

Response Number 5
Name: Alirezan1
Date: January 16, 2005 at 13:17:01 Pacific
Reply:

Hello

Thank you all for your replies. Well, the whole square root thing is not about processors like Intel. Actually, I am trying to do it on Motorola ( Freescale ) HC12 which does not support such an instruction.
I need to figure out how to calculate the fraction part only. It seems like pain in the butt to loop over and over again to devide a 32 bit number or something.

Thanks

Alireza

Alireza

Alireza@arnit.net


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

deleting folders - use ba... final project in java



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Square root in assembly

Binary to ASCII conv. in assembly www.computing.net/answers/programming/binary-to-ascii-conv-in-assembly/12420.html

dynamic allocate memory in assembly www.computing.net/answers/programming/dynamic-allocate-memory-in-assembly/14189.html

read array in assembly language www.computing.net/answers/programming/read-array-in-assembly-language/1012.html