kokokozhina

geron

May 17th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2. fmt: db "%lf", 0
  3. two: dq 2.0
  4.  
  5. section .bss
  6. a: resq 1
  7. b: resq 1
  8. c: resq 1
  9. p: resq 1
  10. res: resq 1
  11.  
  12.  
  13. section .text
  14. extern _scanf
  15. extern _printf
  16. global _main
  17.  
  18. _main:
  19.  
  20. push a
  21. push fmt
  22. call _scanf
  23.  
  24.  
  25. push b
  26. push fmt
  27. call _scanf
  28.  
  29. push c
  30. push fmt
  31. call _scanf
  32.  
  33. add esp, 24
  34.  
  35. fld qword [a]
  36. fadd qword [b]
  37. fadd qword [c]
  38. fdiv qword [two]
  39. fst qword [p]
  40. fst qword [res]
  41. fsub qword [a]
  42.  
  43. fmul qword [p];протолкунуть до st 1 st2 st3 и псделат ьfmul st1 st2 st3
  44. fst qword [res]
  45. fld qword [p]
  46.  
  47. fsub qword [b]
  48. fmul qword [res]
  49. fst qword [res]
  50. fld qword [p]
  51.  
  52.  
  53. fsub qword [c]
  54. fmul qword [res]
  55.  
  56. fsqrt
  57.  
  58. fst qword [res]
  59.  
  60. ;fldpi ;sto = П
  61. ;fmul qword [two]
  62. ;fdivr qword [l] ;st0 теперь = r = l / 2П
  63. ;fldpi ;st0 = п, st1 = r
  64. ;fmul st1 ;st0 = Пr st1 = r
  65. ;fmul st1 ;st0 = пr^2, st1 = r
  66. ;fst  qword [p] ;[l] = Pr^2, st0 = Pr^2, st1 = r
  67. push dword [res + 4]
  68. push dword [res]
  69. push fmt
  70. call _printf
  71. add esp, 12
  72. xor eax, eax
  73. xor ecx, ecx
  74. ret
Add Comment
Please, Sign In to add comment