Garryj, yes, I just discovered this, myself. I'm trying to figure out how to track addresses for ORGH code now. I'm hoping to be able to use ORGH to set up an offset that will be added to all PASM references for address computation. I don't fully have my head around this, yet.
Hub-exec code defined in Spin2 programs now orients properly at $400 (default). Hub-exec programs in Spin must rely on relative addressing:
Also, empty IF/ELSEIF/ELSE/REPEAT/CASE/CASE_FAST blocks are now allowed.
Woohoo! My USB keyboard/mouse Spin2 demo is working now with PNut Spin2.
I've got some code cleanup to do, but I should be posting updated Spin2 demos for both FastSpin and PNut v34m soon.
Hub-exec code defined in Spin2 programs now orients properly at $400 (default). Hub-exec programs in Spin must rely on relative addressing:
Also, empty IF/ELSEIF/ELSE/REPEAT/CASE/CASE_FAST blocks are now allowed.
Woohoo! My USB keyboard/mouse Spin2 demo is working now with PNut Spin2.
I've got some code cleanup to do, but I should be posting updated Spin2 demos for both FastSpin and PNut v34m soon.
Super! I was waiting to hear something from you. Glad it's working.
Nice going GarryJ
Is it the same code that runs under both compilers? Or are there two versions
Currently a version for each. FastSpin hub-exec addressing is mostly absolute, PNut Spin2 addressing is relative. The edits are numerous, but simple. One file doable if PNut gets #ifdef...😉
Nice going GarryJ
Is it the same code that runs under both compilers? Or are there two versions
Currently a version for each. FastSpin hub-exec addressing is mostly absolute, PNut Spin2 addressing is relative. The edits are numerous, but simple. One file doable if PNut gets #ifdef...😉
I'm glad you figured out what to do so quickly and you didn't have any problems. I suppose you could make both versions relatively-addressed. Would there be any code growth if you did that? Did you use the LOC instruction to get addresses of data your program uses?
Nice going GarryJ
Is it the same code that runs under both compilers? Or are there two versions
Currently a version for each. FastSpin hub-exec addressing is mostly absolute, PNut Spin2 addressing is relative. The edits are numerous, but simple. One file doable if PNut gets #ifdef...😉
I'm glad you figured out what to do so quickly and you didn't have any problems. I suppose you could make both versions relatively-addressed. Would there be any code growth if you did that? Did you use the LOC instruction to get addresses of data your program uses?
That is part of the plan, now that both versions are working. Yes, LOC is used extensively and that made it easier to find where changes were needed. I'm done for the night, but I'll dive into this tomorrow.
I would wait for ersmith to be back working on FastSpin. He plans to make it compatible with official Spin2 as much as possible.
I think having two versions for now is ok, eventually you will be able to just keep the official Spin2 version and it'll work on both.
I'd be nice to have something like a macro that could turn 4 byte constants into a long constant...
Something like RGBA(r,g,b,a) or just RGB() or maybe RGBx().
On the other hand, this could be part of some preprocessor that I'm sure somebody will make before long...
Just an inquiry - From the new SPIN2 revision just released, Are there any plans for 64-bit math?
No, but we do have one instruction called MULDIV64, which multiplies two 32 bit unsigned numbers and then divides their 64-bit product by another 32-bit value. It's useful for doing clock frequency computations, where you need 64-bit intermediate values. In that case, the CORDIC handles the 64-bit math.
Another small quirk... You can specify an index for an object reference even if the object isn't defined as an array. This code compiles (I didn't try to run it):
Another small quirk... You can specify an index for an object reference even if the object isn't defined as an array. This code compiles (I didn't try to run it):
Comments
Thank you.
Soon I will add some constants to the compiler for use in cases like this.
HUBEXEC = 32
NEWCOG = 16
COGINIT(HUBEXEC+NEWCOG, @pasmhubcode, 0)
Hub-exec code defined in Spin2 programs now orients properly at $400 (default). Hub-exec programs in Spin must rely on relative addressing:
Also, empty IF/ELSEIF/ELSE/REPEAT/CASE/CASE_FAST blocks are now allowed.
I've got some code cleanup to do, but I should be posting updated Spin2 demos for both FastSpin and PNut v34m soon.
Is it the same code that runs under both compilers? Or are there two versions
That’s a big milestone for Spin2.
Tiny codes are one thing, big ones are another ...
Super! I was waiting to hear something from you. Glad it's working.
I'm glad you figured out what to do so quickly and you didn't have any problems. I suppose you could make both versions relatively-addressed. Would there be any code growth if you did that? Did you use the LOC instruction to get addresses of data your program uses?
That is part of the plan, now that both versions are working. Yes, LOC is used extensively and that made it easier to find where changes were needed. I'm done for the night, but I'll dive into this tomorrow.
I think having two versions for now is ok, eventually you will be able to just keep the official Spin2 version and it'll work on both.
https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit?usp=sharing
I'd be nice to have something like a macro that could turn 4 byte constants into a long constant...
Something like RGBA(r,g,b,a) or just RGB() or maybe RGBx().
On the other hand, this could be part of some preprocessor that I'm sure somebody will make before long...
All methods have parentheses '()' after their names, even if they have no parameters. This helps distinguish methods from variables and constants.
We have some built-in methods which currently and historically have not had parentheses after their names:
Should we change these built-in methods to look like these:
What do you think?
COGID no, because it is more like a constant than a function.
GETCT idk...
I added them. It feels very right, now that it's done.
It expects a "." after the jm_numbers reference in the begin method, as if the object wasn't part of an array.
Okay. I'll have this fixed in about 8 hours. I need to get some sleep, first. Sorry about this. We'll get it figured out soon.
Reply - Thanks, the CORDIC instruction is fine.
Please, no rush on my part. This is a minor issue and I have a workaround. Just wanted to report it.
With so many new features there are bound to be some flaws in the tools.
No, but we do have one instruction called MULDIV64, which multiplies two 32 bit unsigned numbers and then divides their 64-bit product by another 32-bit value. It's useful for doing clock frequency computations, where you need 64-bit intermediate values. In that case, the CORDIC handles the 64-bit math.
For converting 64-bit CT ticks to 32-bit time units, we need a DIV64 method.
Sorry I didn't get to the object index issue yet. I will get to it tomorrow. Yes, you can put an index on just about anything.