Here is the Spin2 interpreter. It includes the brief code that boots up the initial Spin2 instance in cog0, and even a little bytecode program to toggle P0.
The compiler just needs to initialize four longs with the startup data and then append the object blob after the interpreter. Then, you have a Spin2 application ready to load and execute.
I'm at the point now where I just need to modify the compiler to handle the latest changes I've made to the interpreter and then Spin2 should come to life in PNut.exe. Jeff is ready to fit the new Spin2 compiler into the PropellerTool.exe and make the modifications needed to the syntax highlighter.
This interpreter really packs in the functionality using XBYTE. The entire interpreter, including initialization code is 3,564 bytes. It will probably grow to 4KB once all the smart pin auxiliary bytecodes and routines are added in.
Cog registers $000.$140 are free for user PASM programs and data, while $1E0..$1EF serve as the RESULT/parameters/locals conduit for inline assembly and cog/hub calls. Auxiliary bytecodes can be added without any impact on cog registers.
In this example, a 250MHz clock is selected and the following program loops at 3.906MHz:
This file should assemble and run on the current P2 Eval board. (I say "should" because I'm not sure if I've used any operators that might not be in the last release of PNut.exe.)