I would need real Extended precision for my application - some parts

will also be in assembler for speed.

Unfortunately and despite searching the forums and having seen the messages

to 'correct' it, I just can't get it working.

I post here below working code to highlight and visualise the problem:

'Extended precision problems...

#COMPILE EXE

FUNCTION PBMAIN () AS LONG

#REGISTER NONE 'needed as per PB Forum 6-413 or 4-1471

xyz% = 0

! fstcw xyz%

! or xyz%, &B0000001100000000%

! fldcw xyz%

Fs! = 28 / 9 'single precision

Pi# = ATN(1) * 4 'double

Pie## = ATN(1) * 4 'extended precision expected... but only double - possibly due to ATN use?

Fl## = 28/9 : F## = 28/9 'this is still double, not EXT ! Why ???

' ! fld F## ;load in ST(0) => FATAL ERROR !!! - can't load EXT ???

'instruction should be OK to load EXT according to Intel?

! fldPi ;push internal constant Pi onto FPU register stack = ST(0)

'? gives always DOUBLE (rounded 66 bit? according to Intel) instead of EXT

! fst Pid# ;copy ST(0) to Pid# (double precision)

! fstp F## ;copy ST(0) to F## (in EXT?) and pop register stack

MSGBOX STR$(Pi#) + CHR$(13) + STR$(Pie##) + CHR$(13) + STR$(Fl##) + CHR$(13) + _

STR$(Pid#) + CHR$(13) + STR$(F##) + CHR$(13) + STR$(Fs!) 'how can I get Pi in EXT ???

'F## isn't changed by trying to load Pi in extended precision in F##

END FUNCTION 'PBMAIN

The comments and questions in the code and the result (msgbox) should speak for themselves.

I would appreciate if anybody can show me how to get at least the PB code working and the

EXT ASM would be nice to.

Thanks.

Jules

[email protected]

------------------

will also be in assembler for speed.

Unfortunately and despite searching the forums and having seen the messages

to 'correct' it, I just can't get it working.

I post here below working code to highlight and visualise the problem:

'Extended precision problems...

#COMPILE EXE

FUNCTION PBMAIN () AS LONG

#REGISTER NONE 'needed as per PB Forum 6-413 or 4-1471

xyz% = 0

! fstcw xyz%

! or xyz%, &B0000001100000000%

! fldcw xyz%

Fs! = 28 / 9 'single precision

Pi# = ATN(1) * 4 'double

Pie## = ATN(1) * 4 'extended precision expected... but only double - possibly due to ATN use?

Fl## = 28/9 : F## = 28/9 'this is still double, not EXT ! Why ???

' ! fld F## ;load in ST(0) => FATAL ERROR !!! - can't load EXT ???

'instruction should be OK to load EXT according to Intel?

! fldPi ;push internal constant Pi onto FPU register stack = ST(0)

'? gives always DOUBLE (rounded 66 bit? according to Intel) instead of EXT

! fst Pid# ;copy ST(0) to Pid# (double precision)

! fstp F## ;copy ST(0) to F## (in EXT?) and pop register stack

MSGBOX STR$(Pi#) + CHR$(13) + STR$(Pie##) + CHR$(13) + STR$(Fl##) + CHR$(13) + _

STR$(Pid#) + CHR$(13) + STR$(F##) + CHR$(13) + STR$(Fs!) 'how can I get Pi in EXT ???

'F## isn't changed by trying to load Pi in extended precision in F##

END FUNCTION 'PBMAIN

The comments and questions in the code and the result (msgbox) should speak for themselves.

I would appreciate if anybody can show me how to get at least the PB code working and the

EXT ASM would be nice to.

Thanks.

Jules

[email protected]

------------------

## Comment