Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Apr 2nd, 2006, 1:42 PM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
[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
Klarre is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:40 AM.

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