Advertisement
ze3leX

Untitled

Mar 26th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. .section .data
  2. str1: .fill 50,1,42
  3. str1_len = .-str1
  4. not_alphanum: .byte 0
  5. .section .text
  6. .global main
  7. main:
  8. movl $3, %eax
  9. movl $0, %ebx
  10. leal str1, %ecx
  11. movl $str1_len, %edx
  12. int $0x80
  13.  
  14. movl %eax, %esi #esi sadrzi duzinu stringa
  15. leal str1, %eax #adresa stringa u %eax
  16. decl %eax
  17. decl %esi
  18. proveri:
  19. incl %eax
  20. cmpb $'\n', (%eax)
  21. je ispis
  22.  
  23. cmpb $'0', (%eax)
  24. jb zameni
  25.  
  26. cmpb $'9', (%eax)
  27. jbe proveri
  28.  
  29. cmpb $'A', (%eax)
  30. jb zameni
  31.  
  32. cmpb $'Z', (%eax)
  33. jbe proveri
  34.  
  35. cmpb $'a', (%eax)
  36. jb zameni
  37.  
  38. cmpb $'z', (%eax)
  39. jbe proveri
  40.  
  41. zameni:
  42. incb not_alphanum
  43. movb $'0', (%eax)
  44. jmp proveri
  45. ispis:
  46. movl $4, %eax
  47. movl $1, %ebx
  48. leal str1, %ecx
  49. movl %esi, %edx
  50. int $0x80
  51. kraj:
  52. movl $1, %eax
  53. movb not_alphanum, %bl
  54. int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement