loop.asm 480 B

12345678910111213141516171819202122232425262728
  1. section .text
  2. global _start ;must be declared for using gcc
  3. _start: ;tell linker entry point
  4. mov ecx,10
  5. mov eax, '1'
  6. l1:
  7. mov [num], eax
  8. mov eax, 4
  9. mov ebx, 1
  10. push ecx
  11. mov ecx, num
  12. mov edx, 1
  13. int 0x80
  14. mov eax, [num]
  15. sub eax, '0'
  16. inc eax
  17. add eax, '0'
  18. pop ecx
  19. loop l1
  20. mov eax,1 ;system call number (sys_exit)
  21. int 0x80 ;call kernel
  22. section .bss
  23. num resb 1