Advertisement
Guest User

Untitled

a guest
May 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. .686
  2. PUBLIC @Function1@12
  3. .model flat
  4. .stack
  5. .code
  6.  
  7. @Function1@12 proc
  8.  
  9. push ebp
  10. mov ebp, esp
  11. mov esi, [ebp + 8] ;адрес b
  12. mov edi, ecx ;size маленького
  13.  
  14. mov ecx, 1
  15. shl ecx, 16 ;2^16 = size
  16. cycle1:
  17. mov word ptr[esi + 2 * ecx - 2], 0 ;0 в b
  18. loop cycle1
  19.  
  20. mov eax, 0
  21. mov ecx, edi
  22. cycle2:
  23. mov ax, word ptr[edx + 2 * ecx - 2] ;edx=a
  24. inc word ptr[esi + 2 * eax] ;переход по адресу
  25. loop cycle2
  26.  
  27. mov eax, 0
  28. mov ecx, 1
  29. shl ecx, 16 ;сдвиг -> размер
  30. cycle3:
  31. mov bx, word ptr[esi + 2 * ecx - 2] ;значение по индексу
  32. test bx, bx
  33. jz no_instances ;нет вхождений
  34. inc eax
  35. no_instances:
  36. loop cycle3
  37.  
  38. pop ebp
  39. ret 4
  40.  
  41. @Function1@12 endp
  42.  
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement