fork download
  1. .file "tester.c"
  2. .local termination_flag_ptr
  3. .comm termination_flag_ptr,8,8
  4. .text
  5. .type trap_ctrl_c, @function
  6. trap_ctrl_c:
  7. .LFB0:
  8. .cfi_startproc
  9. pushq %rbp
  10. .cfi_def_cfa_offset 16
  11. .cfi_offset 6, -16
  12. movq %rsp, %rbp
  13. .cfi_def_cfa_register 6
  14. movl %edi, -4(%rbp)
  15. movq termination_flag_ptr(%rip), %rax
  16. testq %rax, %rax
  17. je .L1
  18. movq termination_flag_ptr(%rip), %rax
  19. movb $1, (%rax)
  20. .L1:
  21. popq %rbp
  22. .cfi_def_cfa 7, 8
  23. ret
  24. .cfi_endproc
  25. .LFE0:
  26. .size trap_ctrl_c, .-trap_ctrl_c
  27. .section .rodata
  28. .align 8
  29. .LC0:
  30. .string "Calculating, press Ctrl+C to stop..."
  31. .align 8
  32. .LC1:
  33. .string "Calculation was terminated at %llu\n"
  34. .text
  35. .type calculate_something, @function
  36. calculate_something:
  37. .LFB1:
  38. .cfi_startproc
  39. pushq %rbp
  40. .cfi_def_cfa_offset 16
  41. .cfi_offset 6, -16
  42. movq %rsp, %rbp
  43. .cfi_def_cfa_register 6
  44. subq $16, %rsp
  45. movb $0, -9(%rbp)
  46. leaq -9(%rbp), %rax
  47. movq %rax, termination_flag_ptr(%rip)
  48. movq $0, -8(%rbp)
  49. movl $.LC0, %edi
  50. call puts
  51. jmp .L4
  52. .L5:
  53. addq $1, -8(%rbp)
  54. .L4:
  55. movzbl -9(%rbp), %eax
  56. xorl $1, %eax
  57. testb %al, %al
  58. jne .L5
  59. movq -8(%rbp), %rax
  60. movq %rax, %rsi
  61. movl $.LC1, %edi
  62. movl $0, %eax
  63. call printf
  64. leave
  65. .cfi_def_cfa 7, 8
  66. ret
  67. .cfi_endproc
  68. .LFE1:
  69. .size calculate_something, .-calculate_something
  70. .globl main
  71. .type main, @function
  72. main:
  73. .LFB2:
  74. .cfi_startproc
  75. pushq %rbp
  76. .cfi_def_cfa_offset 16
  77. .cfi_offset 6, -16
  78. movq %rsp, %rbp
  79. .cfi_def_cfa_register 6
  80. movl $trap_ctrl_c, %esi
  81. movl $2, %edi
  82. call __sysv_signal
  83. call calculate_something
  84. movl $0, %eax
  85. popq %rbp
  86. .cfi_def_cfa 7, 8
  87. ret
  88. .cfi_endproc
  89. .LFE2:
  90. .size main, .-main
  91. .ident "GCC: (Debian 4.9.2-10) 4.9.2"
  92. .section .note.GNU-stack,"",@progbits
  93.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.s: Assembler messages:
prog.s:9: Error: bad register name `%rbp'
prog.s:12: Error: bad register name `%rsp'
prog.s:14: Error: bad register name `%rbp)'
prog.s:15: Error: bad register name `%rip)'
prog.s:16: Error: bad register name `%rax'
prog.s:18: Error: bad register name `%rip)'
prog.s:19: Error: bad register name `%rax)'
prog.s:21: Error: bad register name `%rbp'
prog.s:39: Error: bad register name `%rbp'
prog.s:42: Error: bad register name `%rsp'
prog.s:44: Error: bad register name `%rsp'
prog.s:45: Error: bad register name `%rbp)'
prog.s:46: Error: bad register name `%rbp)'
prog.s:47: Error: bad register name `%rax'
prog.s:48: Error: bad register name `%rbp)'
prog.s:53: Error: bad register name `%rbp)'
prog.s:55: Error: bad register name `%rbp)'
prog.s:59: Error: bad register name `%rbp)'
prog.s:60: Error: bad register name `%rax'
prog.s:75: Error: bad register name `%rbp'
prog.s:78: Error: bad register name `%rsp'
prog.s:85: Error: bad register name `%rbp'
stdout
Standard output is empty