Advertisement
Artcik

proj4_DOBRY

Dec 14th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. .intel_syntax noprefix
  2. .text
  3. .globl _start
  4.  
  5. _start:
  6. mov edx,[esp+8]
  7. cmp edx,0
  8. jz koniec
  9.  
  10. mov edx,[esp+12]
  11. cmp edx,0
  12. jz koniec
  13.  
  14. xor edx,edx
  15. mov eax,4
  16. mov ebx,1
  17. mov ecx,offset msx
  18. mov edx,2
  19. int 0x80
  20.  
  21. xor edx,edx
  22. mov ecx,[esp+8]
  23.  
  24. petla:
  25. inc edx
  26. cmp byte ptr [ecx+edx-1],0
  27. jnz petla
  28. mov esi,edx
  29.  
  30. mov eax,4
  31. mov ebx,1
  32. int 0x80
  33.  
  34. mov eax,4
  35. mov ebx,1
  36. mov ecx,offset msy
  37. mov edx,3
  38. int 0x80
  39.  
  40. mov ecx,[esp+12]
  41. xor edx, edx
  42.  
  43. loop:
  44. inc edx
  45. cmp byte ptr [ecx+edx-1],0
  46. jnz loop
  47.  
  48. mov eax,4
  49. mov ebx,1
  50. int 0x80
  51.  
  52. mov eax,4
  53. mov ebx,1
  54. mov ecx,offset msg
  55. mov edx,1
  56. int 0x80
  57.  
  58. xor edx,edx
  59. xor ecx,ecx
  60.  
  61. mov ecx,[esp+12]
  62. mov ebx,[esp+8]
  63.  
  64. mov ebp,0
  65.  
  66. literka:
  67. mov ah,byte ptr[ecx+ebp]
  68. cmp ah,0
  69. jz jest
  70.  
  71. cmp ah,byte[ebx+edx]
  72. jz dalej
  73. inc edx
  74. jmp reset
  75.  
  76.  
  77. reset:
  78. mov ebp,0
  79. cmp edx,esi
  80. jz koniec
  81. jmp literka
  82.  
  83. dalej:
  84. inc edx
  85.  
  86. inc ebp
  87. cmp edx,esi
  88. jz koniec
  89. jmp literka
  90.  
  91. jest:
  92. inc edi
  93. jmp reset
  94.  
  95. koniec:
  96. inc edi
  97. mov edx,48
  98. xor ebx,ebx
  99.  
  100. add edx,edi
  101. push edx
  102. mov eax,4
  103. mov ebx,1
  104. mov ecx,esp
  105. mov edx,1
  106. int 0x80
  107. pop edx
  108.  
  109. mov eax,4
  110. mov ebx,1
  111. mov ecx,offset msg
  112. mov edx,2
  113. int 0x80
  114.  
  115. mov eax,1
  116. mov ebx,0
  117. int 0x80
  118.  
  119. .data
  120. msg: .ascii "\n"
  121. msx: .ascii "x="
  122. msy: .ascii "\ny="
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement