Does anyone have an example where they have started a new COG in PASM replacing SPIN in COG zero...so that all eight COGS could/would being running PASM.
What exactly is the problem?
It's well described in the propeller manual. COGINIT is your friend.
Create a long variable where you clear the "NEW"-bit, set the COG bits to 000, set the address of the PAR register and the address where to find the code in HUB RAM. Then call COGINIT where the address of this long is given.
If cog N is running SPIN you might as well re-start it with coginit(cogid, @pasm, parameter). If that's not an option then yes, you'd have to construct a parameter for the coginit instruction and go from there.
Parameter (p) and address (a) can only have 14 relevant bits und must be 4n aligned (the & $FFFC is optional). If you go down this route you may want to construct target dynamically. The expression above is what you'd have to do.
Just thinking out loud here, have you considered that your program may be started in a cog different from #0? In this case you'd run into trouble with hardwiring cog 0 as being (re)started last. Letting the main cog restart itself would avoid that issue.
Comments
It's well described in the propeller manual. COGINIT is your friend.
Create a long variable where you clear the "NEW"-bit, set the COG bits to 000, set the address of the PAR register and the address where to find the code in HUB RAM. Then call COGINIT where the address of this long is given.
Just thinking out loud here, have you considered that your program may be started in a cog different from #0? In this case you'd run into trouble with hardwiring cog 0 as being (re)started last. Letting the main cog restart itself would avoid that issue.