flat assembler
Message board for the users of flat assembler.

Index > Main > pushing double values

Author
Thread Post new topic Reply to topic
zenek_tm



Joined: 21 Mar 2004
Posts: 33
Location: Poland
zenek_tm
Hi all.

I'm new to assembler, so I ask for well commented answers. Smile

1. I need to call a function that requires four 8-byte floating point values. How can I push them on stack to make it work?

2. If I define
Code:
label dq 1.1    
will label contain a 64bit floating point value of 1.1 or 32bit value and 32bits of zero?

Thanks for the answers.
Post 21 Mar 2004, 19:05
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
1. either you can push address of 64bit variable, or push it as two 32bit values, like:
Code:
push [var64 + 4]
push [var64]
    


2. it contains 64bit floating point value of 1.1
Post 21 Mar 2004, 19:59
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
zenek_tm



Joined: 21 Mar 2004
Posts: 33
Location: Poland
zenek_tm
Quote:

1. either you can push address of 64bit variable, or push it as two 32bit values, like:
Code:
    code:
    push [var64 + 4]
    push [var64]
    



I can't push addresses of those values, because it's not my function. And I tried to push them in two parts, but it's not working. Here's the invoke:
Code:
        invoke  gluPerspective, dword [f1], dword [f1+4],\
                                dword [result], dword [result+4],\
                                dword [f2], dword [f2+4],\
                                dword [f3], dword [f3+4]
    

f1, result, f2 and f3 are qword values. Unless I'm not invoking it properly, but I also tried to invoke it like this:
Code:
        invoke  gluPerspective, dword [f1+4], dword [f1],\
                                dword [result+4], dword [result],\
                                dword [f2+4], dword [f2],\
                                dword [f3+4], dword [f3]
    

with the same result (not working).




//EDIT
Sorry for this post. It appears, that calling works, but nothing is drawn. But I can't find the bug in my code. Thank's for the answer and sorry once again.
Post 21 Mar 2004, 20:29
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
The first one seems to be correct, but I do not see where your problem could be. Here is how I use:
Code:
stdcall [glOrtho],dword [wx+00h],dword [wx+04h],dword [ww+00h],dword [ww+04h],dword [wy+00h],dword [wy+04h],dword [wh+00h],dword [wh+04h],dword [wnear+00h],dword [wnear+04h],dword [wfar+00h],dword [wfar+04h]

 wx              dq      0.0
 wy              dq      0.0
 ww              dq      640.0
       wh              dq      480.0
       wnear           dq      -1.0
        wfar            dq      1.0    

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 22 Mar 2004, 01:40
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
i thought OpenGL uses 32bit floating point values.
Post 22 Mar 2004, 06:06
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
zenek_tm



Joined: 21 Mar 2004
Posts: 33
Location: Poland
zenek_tm
vid wrote:
i thought OpenGL uses 32bit floating point values.
Some GL functions are for floats, other are for double like glColor3f (floats) and glColor3d (double). And the problem was with glClearDepth function. It needs double value, and I was giving it a float. Asembly programing is trickier, than I thought.
Post 22 Mar 2004, 07:27
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
but gives you strength! Very Happy
Post 22 Mar 2004, 20:14
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.