slviajero/tinybasic

Some examples not working, wrong usr() return value?#

Closed this issue · 3 comments

Hi. First, thanks for all the work you put into this BASIC, it works well on a PI Pico.

But i have issues with launching some included examples, like lunar.bas. They check for the presence of floating point numbers by running usr(0,3).

This itself works fine, and the function returns 0 if there is no float, and 1 if there is float available.

The problem is that the examples NOT this value, changing 0 to -1, and 1 to -2. This causes incorrect logic behaviour and shows the message about there not being floating point support, on systems that have floating point support.

To clarify, this is what is happening:

Before NOT After NOT
0 (false) -1 (true)
1 (true) -2 (true)

I don't know if I am missing something, or there is something wrong with the examples or the usr() return value.

Thanks

Thank you very much for the explanation and fixing the issue so quickly.