Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   [x86, MASM] Design thoughts (http://www.programmingforums.org/showthread.php?t=9171)

Klarre Apr 2nd, 2006 2:42 PM

[x86, MASM] Design thoughts
 
I have this function written in C++, where a Vec3 is a structure with 3 floats.
:

Vec3 foo(Vec v1, Vec2 v2)
{
    Vec3 retVec;

    retVec.x = v1.x + v2.x;
    retVec.y = v1.y + v2.y;
    retVec.z = v1.z + v2.z;

    return retVec;
}

Now I want to rewrite this function into asm. But I need some design suggestions. How should you do this? Should I store the three values that retVec keeps after each other and return the adress to the first element? This is the only idea I can come up with.

Thanks for any suggestions!

/Klarre


All times are GMT -5. The time now is 5:13 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC