Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // ConsoleApplication6.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5.  
  6. int parVector(int*, int)
  7. {
  8. int s = 0;
  9. _asm {
  10. mov ecx,[ebp+8]
  11. mov esi,0
  12. fori:
  13. cmp esi,[ebp+12]
  14. jae stopfor
  15. mov edx,0
  16. mov eax, [ecx + 4*esi]
  17. mov ebx,2
  18. div ebx
  19. cmp edx,0
  20. je suma
  21. suma : add s, eax
  22. inc esi
  23. jmp fori
  24. stopfor:
  25. mov eax,s
  26. }
  27. }
  28. int main()
  29. {
  30. int n = 5, v[] = { 4,0,1,1,1 };
  31. printf("%d\n", parVector((int *)v, n));
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement