Advertisement
_takumi

funcs.asm

Nov 27th, 2022
1,734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     .intel_syntax noprefix
  2.     .section    .rodata
  3.     .align 8
  4. .LC2:
  5.     .string "Incorrect input, check README.md"
  6. .LC3:
  7.     .string "r"
  8. .LC4:
  9.     .string "w"
  10. .LC5:
  11.     .string "Incorrect file"
  12. .LC6:
  13.     .string "%lf"
  14. .LC8:
  15.     .string "|x| must be less than 1"
  16. .LC10:
  17.     .string "Answer = %lf\n"
  18.     .text
  19.     .globl  f
  20.     .type   f, @function
  21. f:
  22.     push    rbp
  23.     mov rbp, rsp
  24.     movsd   QWORD PTR -40[rbp], xmm0 # x
  25.     movsd   QWORD PTR -48[rbp], xmm1 # m
  26.     movsd   QWORD PTR -56[rbp], xmm2 # n
  27.     movsd   xmm0, QWORD PTR .LC0[rip]
  28.     movsd   xmm4, xmm0 # sum
  29.     movsd   xmm0, QWORD PTR .LC0[rip]
  30.     movsd   xmm5, xmm0 # tmp
  31.     pxor    xmm0, xmm0
  32.     movsd   xmm3, xmm0  # i
  33.     jmp .L2
  34. .L3:
  35.     movsd   xmm0, QWORD PTR -48[rbp]
  36.     subsd   xmm0, xmm3
  37.     mulsd   xmm0, QWORD PTR -40[rbp]
  38.     movsd   xmm2, xmm3
  39.     movsd   xmm1, QWORD PTR .LC0[rip]
  40.     addsd   xmm1, xmm2
  41.     divsd   xmm0, xmm1
  42.     movsd   xmm1, xmm5
  43.     mulsd   xmm0, xmm1
  44.     movsd   xmm5, xmm0
  45.     movsd   xmm0, xmm4
  46.     addsd   xmm0, xmm5
  47.     movsd   xmm4, xmm0
  48.     movsd   xmm1, xmm3
  49.     movsd   xmm0, QWORD PTR .LC0[rip]
  50.     addsd   xmm0, xmm1
  51.     movsd   xmm3, xmm0
  52. .L2:
  53.     movsd   xmm0, QWORD PTR -56[rbp]
  54.     comisd  xmm0, xmm3
  55.     ja  .L3
  56.     movsd   xmm0, xmm4
  57.     pop rbp
  58.     ret
  59.     .size   f, .-f
  60.     .section    .rodata
  61.     .align 8
  62. .LC0:
  63.     .long   0
  64.     .long   1072693248
  65.     .align 8
  66. .LC7:
  67.     .long   0
  68.     .long   -1074790400
  69.     .align 8
  70. .LC9:
  71.     .long   0
  72.     .long   1078525952
  73.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement