FORTH based Propeller assember for PropellerForth
Bazmundi
Posts: 3
Hey team,
I am a FORTH nut from way back and have had my interest rekindled because of the propeller chip and propelerForth.
It doesn't appear to have an assembler.
No problem, one of my favourite passtimes was writing assemblers in Forth.
Problem is I have found a piece of information on the bit fields for op codes used in the propeller but not the bit field contents and how they relate to op codes.
Has anyone got a table of propeller op codes and their bit field values?
Cheers,
Baz
I am a FORTH nut from way back and have had my interest rekindled because of the propeller chip and propelerForth.
It doesn't appear to have an assembler.
No problem, one of my favourite passtimes was writing assemblers in Forth.
Problem is I have found a piece of information on the bit fields for op codes used in the propeller but not the bit field contents and how they relate to op codes.
Has anyone got a table of propeller op codes and their bit field values?
Cheers,
Baz
Comments
When I was a Propeller newbie I had a go at writing a Forth for it. It didn't look pretty. Recently I revisited the Forth compiler as I had been doing some work with an ARM Forth that I had written a few years ago and I really wanted this kind of functionality with the Prop. On the ARM system I could hook up a keyboard and a monitor and access the SD card so it was a complete O/S as well, all with a CPU that costs the same as the Prop.
Sp using my honed PASM skills I tried a few different angles, even reading 4 byte tokens per long to keep the hub overhead down and keeping track of it all. Everything I tried so far shows up the inadequacies of the Prop architecture for a truly efficient Prop Forth. The best I think I could manage would be around 1 to 2 million Forth instructions per second. Ok, that's faster than Spin maybe but it felt kludgey. The hub access really slows things down but even the address interpreter takes way too many cycles. In ARM this is what it looks like:
Bear in mind I was running the ARM at 66MHz which meant that each instruction took around 15ns so the whole address interpreter executes faster than a single PASM instruction. But what about the primitives, take the SWAP instruction for instance, here it is in ARM:
Compare this with a good Propeller Forth "PropForth" by Sal Sanci:
That doesn't look too bad although each instruction is much slower than ARM and there are more instructions including the subroutines. How about those subroutines then?
My new version in PASM looks very efficient (used a simple PLUS primitive rather than my incomplete SWAP):
But all this is further let down by the limited assembler code that can be run in a cog, except for a handful of primitives the rest of the kernel has to be coded in high level tokens which are already slow.
My feeling is that the best Forth that can be implemented on the Propeller would still be a crippled Forth as well as hog resources and not leave room for much else. This is also a reason I advocate using a cheap ARM chip alongside the Propeller as Co-processors together. Let the Prop do what it does best as it is an I/O wizard but still a microcontroller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
While everyone else is flashing LEDs [noparse]:)[/noparse]
Even I was doing more advanced things back then. I was flashing the LED's backwards,.
@Peter
I always enjoy reading your posts and have learn plenty from your efforts. Thanks!
The best I can do is flash the LED's upside down. [noparse];)[/noparse]
Maybe we'll see some additional FORTH development.
We should encourage Peter to pick up work again on his version.
He has a brilliant mind when occupied by projects like this!