daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .intel_syntax noprefix
  2.     .text
  3.     .global main
  4. main:
  5.     mov ecx, 5000
  6.     mov eax, [esp+8]
  7.     mov eax, [eax+4]
  8.     finit
  9.  
  10.     push eax
  11.     call atof
  12.     add esp, 4
  13.    
  14.     fstp QWORD PTR x
  15.  
  16.     fld qword ptr x
  17.     fst qword ptr y
  18.  
  19. sinus:
  20.     fld qword ptr c
  21.     fld1
  22.     fld1
  23.     faddp
  24.     faddp
  25.     fstp qword ptr c #incrementacja c
  26.  
  27.    
  28.     fld qword ptr y
  29.     fld qword ptr x
  30.     fld qword ptr x
  31.     fmulp
  32.     fmulp
  33.     fchs
  34.     fst qword ptr y #licznik na stos
  35.  
  36.    
  37.     fld qword ptr c
  38.     fld qword ptr c
  39.     fld1
  40.     fsubp
  41.     fmulp
  42.     fld qword ptr lastsilnia
  43.     fmulp
  44.    
  45.     fst qword ptr lastsilnia #silnia na stos
  46.    
  47.     fdivp #x^3n/3n!
  48.     #
  49.     fst qword ptr temp
  50.     fld qword ptr temp
  51.     #
  52.     fabs
  53.     fld qword ptr eps
  54.     fcompp
  55.     fstsw ax
  56.     sahf
  57.     jnb sdsds
  58.  
  59.    
  60.     faddp
  61.  
  62.     jmp sinus
  63.  
  64.     #dec ecx
  65.     #cmp ecx, 0
  66.     #jg sinus
  67. sdsds:
  68.  
  69.  
  70.     faddp
  71.         fstp qword ptr y
  72.  
  73. wypisz:
  74.     fld qword ptr y
  75.     sub esp, 8
  76.     fstp qword ptr [esp]
  77.     mov eax, offset messg
  78.     push eax
  79.     call printf
  80.     add esp, 12
  81.     mov eax, 0
  82.     ret
  83. .data
  84.     x:  .double 1.0
  85.     y:  .double 1.0
  86.     c:  .double 1.0
  87.     temp: .double 1.0
  88. lastsilnia: .double 1.0
  89.     eps: .double 0.000000000000000001
  90.     messg: .asciz "Wynik=%f\n"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top