Cannot compile "put"
pik33
Posts: 2,388
mount "/sd", _vfs_open_sdcard() dim r,test as ulong chdir("/sd") ' set working directory open "/sd/testfile" for output as #3 put #3,0,test,1,r close #3
The result:
/home/pik33/programowanie/P2-retromachine/Propeller/Tracker player/test112.bas:6: error: Unsupported operator 0x0
Comments
Could be that the pos parameter needs to be a '1' or greater...
The flexprop BASIC language description of put includes "starting at position pos in the file (where pos is 1-based)"
Try:
Just a guess, really!
I tried
put #3,1,test,1,r
and
put #3,,test,1,r
with the same result
error: Unsupported operator 0x0
Did you try?:
Now I did.
error: Cannot take address of expression
This compiled for me with flexprop version 5.9.8...
What flexprop version are you running?
There's a bug in the setting of the put/get result value. Either leave the result off, or else use the current github source code which has this fixed.
Thanks for the bug report,
I compiled the newest version - Prop2Play stopped to do the directory/file list. I had to return to older Flexprop, which can compile working prop2play. If I manage to catch the error using the simple example, I will put it here.
Edit: the bug can actually be in prop2play, but the older Flexprop can make it work as expected while the new Flexprop cannot - I am now testing simple examples to catch the problem.
I got lost. Simple examples work, the player does not. What is weird, is - in the player:
I commented out opening #0 in the player, so I used standard system print to serial terminal for testing this
If I uncomment the line "print filename2$" the loop works and the directory list is saved to a file and printed on ANSI termina;
If I comment the "print filename2$" line as in this code block, it lists only first directory element to the file.
The next step: compile with old and new flexprop, compare the lst files.
Edit: lists are different:
new:
old:
Instead of __basic_dir we have now __system__basic_dir... to be continued...
I gave up.
My "old" flexprop that compiles running version of prop2play is Version 5.9.9-beta-HEAD-v5.9.7-19-g1c955d38 Compiled on: Feb 12 2022
My "new" flexprop that compiles not fully working prop2play is Version 5.9.9-HEAD-v5.9.7-33-g89e95693 Compiled on: Feb 26 2022
I don't know what changed and what can make such difference. The workaround is to continue with the "old" version
Does changing the optimization level change the behavior?
Given you seem to be compiling the compiler yourself, try the git bisect command on the spin2cpp repository. That lets you find the change that causes your issue. Basically, you'd do
and then it checks out some in-between version for you. Compile that with
and test with the built compiler. If it works,
git bisect good
, elsegit bisect bad
. It will then check out another version, etc, repeat until it has found the commit of interest. Thengit bisect reset
to return the repository to a clean state.I will try to do this git thing (which I didn't know of yet).
I compile with -O1. O2 gives garbage.:
error: Internal error exceeded local register limit, possibly due to -O2 optimization needing additional registers or code being too complicated
Without optimization the code is way too huge (256 K or something like this). It is already way too huge with -O1 but I will consider a size optimization when all basic things can work. Now it is still at alpha stage.
The result:
So, yes, that was the change which made the difference.
What I did, was:
DeclareFunction(systemModule, rettype, 1, funcdef, body, attrib, $1);
back to
DeclareFunction(current, rettype, 1, funcdef, body, attrib, $1);
Then after make install.. it works
The question is: why this change made this difference
I've made some changes just now that might help your situation. The root problem is that some functions are being duplicated in the system and main modules.
It works, but dir$("*", fbNormal) still lists also directories, which I think it shouldn't do as there is no way to get a list of files only. This is now not a problem, I know where to add the patch.