Skip to main content
GameDev.net gamedev.net
🔒 Locked

Load float constant using FPU

Started by JoeZ Oct 6, 2002 at 1:56 PM 2 replies 250+ views
Original Post
JoeZ
JoeZ
Hello: I have a problem load a float constant using FPU #define myconstant 1.00f int AddNumber(float ii){ fld ii; fld myconstant; //error occurs here //inline assembler syntax error in ''second operand''; found ''constant'' } I would like to know how to load this constant thanks
Shannon Barber
Shannon Barber
static const float myconstant = 1.00f;

int AddNumber(float ii){

fld ii;
fld myconstant; //error occurs here



- Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]

[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
[Free C Libraries | zlib ]

The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
JoeZ
JoeZ
: )
I am just lazy

I know it starts with

_asm{

finit;//init 8087


and ends with }

and I left out the other parts

help?
Jan Wassenberg
Jan Wassenberg
fld takes a memory operand.
If your constant is 1.0, you can use fld1.
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.