these are the .cpp file and the .asm file
#define WIN32_LEAN_AND_MEAN#include <iostream>using namespace std;extern "C" int *myFunc(float *a, float *b, float *result);int main(int argc, char *argv[]){ float inA[] = {1.0f, 2.0f, 3.0f, 4.0f}; float inB[] = {1.0f, 2.0f, 3.0f, 4.0f}; float ret[4]; myFunc(inA, inB, ret); cout << ret[0] << endl; cout << ret[1] << endl; cout << ret[2] << endl; cout << ret[3] << endl; system("pause"); return 0;}
.586P.XMM.MODEL FLAT, C.STACK.DATA.CODEmyFunc PROC a:DWORD, b:DWORD, result:DWORDmovups xmm0, [a]movups xmm1, addps xmm0, xmm1movups [result], xmm0retmyFunc ENDPEND
I was expecting to get the result
Quote:2
4
6
8
but instead got
Quote:-1.07374e+008
-1.07374e+008
-1.07374e+008
-1.07374e+008
can anyone help me out?