dmsc/fastbasic

Cross compiler sometimes fails to link floating-point SIN/COS constants

ukcroupier opened this issue · 2 comments

very minor issue.

I'm getting errors when printing with commas in floating point version of the cross compiler. The following line:

? 1,2

Gives an error (it works fine in the IDE and integer compiler) and semi-colons are ok too:

Compiling 'text.tur' to assembler.
Assembling 'C:\cc65\fb\10linersPOP\text.asm' to object file.
Linking 'C:\cc65\fb\10linersPOP\text.o' to XEX file.
ld65: Error: src/interp/fp_sincos.asm(82): PI/2 and 90 fp constants in different pages

dmsc commented

Hi!

Thanks for the bug report.

Sadly, this has nothing to do with the commas, it is a bug in the runtime in the SIN and COS routines - and I'm surprised it did not show earlier.

The problem is that the floating point library expects the the mentioned constants (PI/2 and 90) in the same memory page, but in your case, the linker placed the two at different pages. This occurs randomly depending on which code is included .

The workaround for now is to change the code a little, until the assembly rearranges itself.

I will try to come up with a proper solution later.

Have Fun!

No problem, I was only using it to report info for debugging.