flat assembler
Message board for the users of flat assembler.
Index
> Main > push signleprecision st0? |
Author |
|
edfed 11 Mar 2010, 13:56
i seek a way to push a floating-point dword onto the stack after a computation with FPU.
maybe the answer is with fist [ss:ebp] but i don't know |
|||
11 Mar 2010, 13:56 |
|
revolution 11 Mar 2010, 14:00
Code: sub esp,4 fst dword[esp] |
|||
11 Mar 2010, 14:00 |
|
edfed 11 Mar 2010, 16:20
cool! yes, of course, i am dumb!
thank you! |
|||
11 Mar 2010, 16:20 |
|
Borsuc 12 Mar 2010, 13:42
Why sub esp, 4????? use "push reg" (any register) it's much smaller.
Code: push eax fst dword[esp] |
|||
12 Mar 2010, 13:42 |
|
Borsuc 12 Mar 2010, 13:48
yeah but i thought he was doing some FPU computations so that should be enough... anyway, you can use 'push esp' instead.
|
|||
12 Mar 2010, 13:48 |
|
edemko 12 Mar 2010, 13:51
i think push'es are more consumptive than simple sub's
it depends on the situation you have |
|||
12 Mar 2010, 13:51 |
|
edfed 12 Mar 2010, 13:57
it is in order to work with opengl and computes coordinates with FPU.
Code: quad: .call=0 .p1=4 .p2=8 .p3=12 .p4=16 .c=20 .x=0 .y=4 .z=8 .r=0 .g=4 .b=8 invoke glBegin,[edi+.call] mov esi,[edi+.c] invoke glColor3f ,[esi+.r],[esi+.g],[esi+.b] mov esi,[edi+.p1] invoke glVertex3f,[esi+.x],[esi+.y],[esi+.z] mov esi,[edi+.p2] invoke glVertex3f,[esi+.x],[esi+.y],[esi+.z] mov esi,[edi+.p3] invoke glVertex3f,[esi+.x],[esi+.y],[esi+.z] mov esi,[edi+.p4] invoke glVertex3f,[esi+.x],[esi+.y],[esi+.z] invoke glEnd ret for the moment, the quad is extracted from a struture like this: Code: quad1: dd GL_QUADS,.dot1,.dot2,.dot3,.dot4,.c .dot1: dd 0.0 , 0.0 , 0.0 .dot2: dd 1.0 , 0.0 , 0.0 .dot3: dd 0.707, 0.707, 0.0 .dot4: dd 0.0 , 1.0 , 0.0 .c : dd 0.0 , 1.0 , 0.0 and then, i will simplify the structure with ints, forced to the XY plane, then, only 2D. and colors will be simplified with a unique dword AARRGGBBh the battle is starting! |
|||
12 Mar 2010, 13:57 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.