How do I go about Power and Square root functions in
Assembly Language (with/out) Stack on Linux.
Edit 1 : I’m programming for Intel x_86.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In x86 assembly, there is no instruction for a Power operation, but you can build your own routine for calculating Power() by expressing the Power in terms of logarithms.
The following two instructions calculate logarithms:
There are several ways to compute the square root:
(1) You can use the FPU instruction
(2) alternatively, you can use the following SSE/SSE2 instructions: