Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication6.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- int parVector(int*, int)
- {
- int s = 0;
- _asm {
- mov ecx,[ebp+8]
- mov esi,0
- fori:
- cmp esi,[ebp+12]
- jae stopfor
- mov edx,0
- mov eax, [ecx + 4*esi]
- mov ebx,2
- div ebx
- cmp edx,0
- je suma
- suma : add s, eax
- inc esi
- jmp fori
- stopfor:
- mov eax,s
- }
- }
- int main()
- {
- int n = 5, v[] = { 4,0,1,1,1 };
- printf("%d\n", parVector((int *)v, n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement