Advertisement
artur99

ASM De câte ori apare elementul x într-un vector

Jan 24th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. int count(int *, int, int) {
  2.     _asm{
  3.         mov eax, 0
  4.         mov edi, 0
  5.         mov ebx, [ebp+8]
  6.         mov ecx, [ebp+12]
  7.         mov edx, [ebp+16]
  8.  
  9.         _while:
  10.         cmp edi, ecx
  11.         je _endwhile
  12.             cmp edx, [ebx + 4*edi]
  13.             jne _skip_inc
  14.                 inc eax
  15.             _skip_inc:
  16.  
  17.             inc edi
  18.             jmp _while
  19.         _endwhile:
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement