fork download
  1. global main
  2. extern printf
  3. extern scanf
  4. extern exit
  5. section .text
  6. main:
  7. push dword a
  8. push f1
  9. call scanf
  10. mov eax, dword [a]
  11. xor edx,edx
  12. mov ecx, $1
  13. start:
  14. inc edx
  15. imul ecx,edx
  16. cmp eax,ecx
  17. je end
  18. jmp start
  19. end:
  20. push edx
  21. push f1
  22. call printf
  23. call exit
  24. ret
  25. section .data
  26. f1: db "%d", 0
  27. section .bss
  28. a:resd 1
  29.  
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+0xb): undefined reference to `scanf'
prog.o: In function `end':
prog.asm:(.text+0x2f): undefined reference to `printf'
prog.asm:(.text+0x34): undefined reference to `exit'
stdout
Standard output is empty