Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. .section .data
  2. string: .ascii " abcd \0"
  3.  
  4. .section .text
  5. .global main
  6.  
  7. main:
  8. movl $string, %eax
  9.  
  10. kraj_stringa:
  11. cmpb $0, (%eax) #cmp B - "b" pise zato sto poredimo po jedan karakter, po jedan bajt
  12. je razmaci
  13. incl %eax
  14. jmp kraj_stringa
  15.  
  16. razmaci: #izbacivanje razmaka sa kraja
  17. cmpb $' ', -1(%eax)
  18. jne izbaci
  19. decl %eax
  20. jmp razmaci
  21.  
  22. izbaci:
  23. movb $0, (%eax) #smijesta \0 na mjesto na koje pokazuje (%eax)
  24.  
  25. kraj:
  26. movl $1, %eax
  27. movl $0, %ebx
  28. int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement