Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ukcroupier opened this issue Jan 17, 2022 · 2 comments
Assignees
Labels

Comments

@ukcroupier
Copy link

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 dmsc added the bug label Jan 18, 2022
@dmsc dmsc self-assigned this Jan 18, 2022
@dmsc
Copy link
Owner

dmsc commented Jan 18, 2022

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!

@ukcroupier
Copy link
Author

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

@dmsc dmsc changed the title Floating point compiler error with comma Cross compiler sometimes fails to link floating-point SIN/COS constants Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants