Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main:
- 6 mov eax, [esp+8]
- 7 mov eax, [eax+4] #arg[1]
- 8
- 9 finit
- 10
- 11 fldpi # pi
- 12 fld1 # 1
- 13 fld1 # 1
- 14 faddp # 2
- 15 fmulp # 2 * pi
- 16
- 17 push eax
- 18 call atof # x = atof(argv[1]);
- 19 fprem #x = x/2pi
- 20 pop eax
- 21
- 22 fld st(0) # y = x
- 23 fld st(0) # a = x
- 24
- 25 #sub esp, 0x8
- 26 mov ecx,1 # n = 1
- 27 jmp warunek
- 28 petla:
- 29 # x y a
- 30
- 31 fld st(2)
- 32
- 33 # x y a x
- 34
- 35 fmul st(0), st(0)
- 36
- 37 # x y a x^2
- 38
- 39 # teraz a *= x * x / ((n + 1) * (n + 2)) * -1;
- 40
- 41 lea eax, [ecx + 1]
- 42 lea ebx, [eax + 1]
- 43 mul ebx
- 44 neg eax
- 45 push eax
- 46 fild dword ptr [esp] # -1 / ((n + 1) * (n + 2))/laduje liczbe z danego a dresu i przeksztalca na rzeczwywista
- 47 pop eax
- 48
- 49 fdivp
- 50 fmulp
- 51
- 52 # x y a
- 53 # ^
- 54 # wierzch stosu
- 55
- 56 fld st(0)
- 57 # x y a a
- 58 # ^
- 59 # wierzch stosu
- 60
- 61 faddp st(2)
- 62 add ecx, 2
- 63
- 64 warunek:
- 65 fld st(0)
- 66 fabs # |a| st[0]
- 67 fld qword ptr eps
- 68 fcomip #st0 z st[i]
- 69 fstp st(0) # zdejmij |a|
- 70 jc petla # while |a| > eps
- 71
- 72 sub esp, 0x8
- 73 fstp st(0) # zdejmij a
- 74
- 75 fstp qword ptr [esp] # wstaw x na stos
- 76 lea eax, messg
- 77 push eax
- 78 call printf
- 79
- 80 add esp, 0xc # wyrównaj stos
- 81 ret
- 82
- 83 .data
- 84 eps: .double 0.0000001
- 85 messg: .asciz "wynik sinusa: %lg\n"
- 86
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement