H
H
Hermit_2k192020-06-08 21:46:12
assembler
Hermit_2k19, 2020-06-08 21:46:12

How to evaluate fractional expressions in Assembler?

For example, given the following example. Can you show how to do this with an example?5ede87653a8a2711594818.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2020-06-08
@Hermit_2k19

In your case, these are cycles, cycles and more cycles with multiplication, division and addition.
And if for an adult these are extended FPU commands and SIMD operations.

M
mayton2019, 2020-06-08
@mayton2019

I didn’t write on Asma for 15 years. But the basis of this code should be some numerical method that counts a certain series in a cycle. In a generalized development language, it would look like this

double func(double x) {
 double sum = 0.0;
 for(int i=1 ; i <= 11 ; i+=2) {
  sum += pow(x,i) / i;
 }
 return sum;
}

This source can be assembled with any C++ compiler with the option to output an assembler listing and further - improve it for yourself.
In general, it is not clear why the author is waiting for a ready-made solution without even writing an empty loop or a hello world template. Is it laziness? Or the desire to immediately get a ready-made solution? Can not be so. We need to show pro-activity.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question