fork download
  1.  
  2.  
  3.  
  4. global main
  5.  
  6. extern exit
  7. extern printf
  8. extern scanf
  9.  
  10.  
  11. section .text
  12.  
  13. main:
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. xor edx, edx
  24. push dword a
  25. push dword a1
  26. call scanf
  27. ; ost edx
  28.  
  29.  
  30. mov ebx, dword [a]
  31. mov eax, $1
  32. mov ecx, $1
  33.  
  34. L1: cmp ecx, ebx
  35. je L2
  36. imul ecx, eax
  37. inc eax
  38. jmp L1
  39. L2:
  40. Mov dword [a], eax
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. push dword [a]
  51. push a2
  52. call printf
  53.  
  54.  
  55. push dword 0
  56. call exit
  57. ret
  58.  
  59. section .data
  60.  
  61.  
  62. a1 : db "%d",0
  63. a2: db "%d",0xA,0
  64.  
  65. section .bss
  66. a: resd 1
  67. b: resd 1
  68.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
ld: warning: cannot find entry symbol _start; defaulting to 00000000080480a0
prog.o: In function `main':
prog.asm:(.text+0xd): undefined reference to `scanf'
prog.o: In function `L2':
prog.asm:(.text+0x3f): undefined reference to `printf'
prog.asm:(.text+0x49): undefined reference to `exit'
stdout
Standard output is empty