I am student of 1 year of IT and now we have inline asembly. I trying to make function that will add two numbers but i got "floating point error"
#include <iostream>
int sum(int a, int b){
int wynik;
__asm__(
"movl 8(%%ebp), %%eax;"
"addl 12(%%ebp), %%eax;"
"movl %%eax, %0;"
: "+r"(wynik)
:
: "cc"
);
return wynik;
};
int main(void)
{
int a, b;
a = 3;
b = 7;
std::cout << sum(a, b) << "\n";
return 0;
}