floating point operations dont work, even fldpi
fstp comes up as 0, tons of other code ive written comes up as 0 or gets errorr HELLP, i have intel celron 768mhz and using .386 directive

using masm
Posted on 2002-04-16 16:39:35 by Qages
Try using




...or the others - .386 doesn't include FPU support, iirc.
Posted on 2002-04-16 16:49:44 by bitRAKE
i still get 0 with .486
Posted on 2002-04-16 17:05:31 by Qages
Can you post a section of code that reproduces the problem?
Posted on 2002-04-16 17:09:42 by bitRAKE
i did,


x endp
Posted on 2002-04-16 17:11:40 by Qages
Do you even have a 8087 co-processor?

Sorry if ithis is insulting, but when all else fails....
Posted on 2002-04-16 17:21:57 by NaN
How is pUSED defined? What is the parameter FLOATPTR used for? How are you determining that the result is zero?
Posted on 2002-04-16 17:46:01 by bitRAKE
sorry, i typed that by hand, replace the FLOATPTR i used with the other 1 i typed in. i dont know any thing about my prossesor ,its relativly new so... i ve checked it in vb and done a compare in asm if it was 0(proc coded diffrent), all other 3 pramaters work fine(proc codded diffrent)
Posted on 2002-04-16 17:56:38 by Qages
i have a 686 co-prossesor is built in.
Posted on 2002-04-16 18:19:36 by Qages
I'd check the code in a debugger like OllyDbg. You could verify code generation and execution very quickly.
Posted on 2002-04-16 18:38:52 by bitRAKE
i think ive found the problem,

mov ebx, 0012F544h
mov eax, pUSED ;<--- pramertar passed in
fld Dfree;10k

following works,0012F544h is the memory address that ive gotten from eax and was returned to my vb program.then i added the new ebx ....code, and lo and behold it displyes 10,000 insted of 0
Posted on 2002-04-16 19:16:00 by Qages
a regestar must be used for fstp!
Posted on 2002-04-16 19:38:05 by Qages
No, you can do:

MyNumber QWORD 0

fstp MyNumber

...register not required.
Posted on 2002-04-16 20:27:00 by bitRAKE
ive tryed that, it gives me 0 as a result
Posted on 2002-04-16 20:28:17 by Qages
Hmm... who built your 686 CPU/Co-processor? This is truely odd...
Posted on 2002-04-16 20:57:49 by NaN
its no matter, i have tons of space regertars to use
Posted on 2002-04-16 20:59:30 by Qages


x endp

I assume you want to store pi in the variable that FLOATPTR *points to*?
Your code merely overwrites the pointer on the stack - in this case,
yes, you will need to load floatptr into a register and store that way.
Posted on 2002-04-17 07:30:45 by f0dder