Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. .section .data
  2. EL = 10
  3. MAX = 20
  4. str:
  5. .fill 10 * 20
  6. .section .text
  7. .globl main
  8. main:
  9. movl $EL , %edi #brojac za prolaz kroz stringove i
  10. movl $str , %esi #adresa na koju treba upisati
  11. upis:
  12. movl $3 , %eax
  13. movl $0 , %ebx
  14. movl %esi, %ecx
  15. movl $MAX, %edx
  16. int $0x80 #ucitava string
  17. addl $20 , %esi #pomera memoriju za upis za 20 bajta udesno
  18. decl %edi #i--
  19. cmpl $0, %edi
  20. jne upis #ako nije poslednji nastavlja sa ucitavanjem
  21. movl $EL , %edi #resetuje pokazivac
  22. subl $20 , %esi #postavlja adresu na poslednje mesto
  23. ispis:
  24. movl $4 , %eax
  25. movl $1 , %ebx
  26. movl %esi, %ecx
  27. movl $MAX, %edx
  28. int $0x80 #ispisuje string
  29. subl $20 , %esi #pomera memoriju za 20 bajta ulevo
  30. decl %edi #i--
  31. cmpl $0, %edi
  32. jne ispis #ako nije poslednji nastavlja ispis
  33. kraj:
  34. movl $1 , %eax
  35. movl $0 , %ebx
  36. int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement