fastbasic icon indicating copy to clipboard operation
fastbasic copied to clipboard

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

Open ukcroupier opened this issue 3 years ago • 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

ukcroupier avatar Jan 17 '22 16:01 ukcroupier

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!

dmsc avatar Jan 18 '22 18:01 dmsc

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

ukcroupier avatar Jan 18 '22 20:01 ukcroupier