D
D
dmitrysergeevich1982019-12-22 23:23:32
assembler
dmitrysergeevich198, 2019-12-22 23:23:32

How to make fully working code?

fld [x]
ftst
fstsw ax
sahf
jbe @2
  fsin
  fadd st(0), st(0)
  jmp _store
@2:
  fld1
  fld1
  fadd st(0), st(0)
  faddp st(1), st(0)
  fadd st(0), st(0)
  fsubrp st(1), st(0)
_store:
  fstp [y]

---------
Task:
For a given real x, find the value of the following function f, which takes real values:
f(x) = 2 * sin(x), if x>0
6 - x, if x<=0

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question