Skip to content

Instantly share code, notes, and snippets.

@gluschenko
Created November 2, 2014 13:36
Show Gist options
  • Save gluschenko/3564ac367ed2156f9fa9 to your computer and use it in GitHub Desktop.
Save gluschenko/3564ac367ed2156f9fa9 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
///
static int Additive(int first, int second);
///
int main()
{
for (int i = 0; i < 10; i++)
{
cout << i << " + 2 -> " << Additive(i - 2, i) << endl;
}
system("pause");
return 0;
}
static int Additive(int first, int second)
{
int sum = 0;
__asm{
mov ebx, [first]
mov ecx, [second]
add edx, ecx
mov [sum], edx
};
return sum;
}
static int AsmValue(int op)
{
__asm{
};
return op;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment