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
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?
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.
Summary: Hello, I want to know how to convert 8 bit binary to it's BCD equivalent in assembly and to ascii as well. I am specifically interested in HC11/HC12 assembly but if anyone knows how to do it in Intel ...
Summary: This needs to be in assembly for sparc processor. I can call c functions but not c++. How do I dynamically allocate memory for a variable from within the assembly code? Do I have to call malloc? Is t...
Summary: Hello: can someone shows me how to read and compute average from an array? For Example: 59,89,98,90 ; james 45,24,78,85 ; susan how to compute the average for James, and susan in assembl...