The long FF FF F9 FF FF FF F9 FF is pushed into the stack when it is setup for the Spin interpreter. I believe that, when this is popped off the stack by a RETURN like the implied RETURN at the end of the main method executed, it will execute a \COGSTOP(COGID) in ROM. This also provides a default exit for an ABORT statement.
The Propeller Tool provides both a Spin bytecode compiler and an assembler for native instructions and source programs can have a combination of both, but any given cog will either be executing a copy of the Spin bytecode interpreter or a user supplied assembly program. Normally the two can not be combined. There have been a variety of modified Spin interpreters created and posted here by forum participants that allow short pieces of assembly code to be mixed with Spin bytecodes. This has usually been done by using the one or two undefined Spin bytecodes to copy a small block of native instructions into the cog running the interpreter, then executing the copied instructions. Since the Spin interpreter uses essentially all the memory available in the cog, room for the extension is made by moving the instructions for several rarely used interpretive codes into hub memory and using the same copy mechanism to copy the instructions temporarily back into the cog for execution.
Comments
The Propeller Tool provides both a Spin bytecode compiler and an assembler for native instructions and source programs can have a combination of both, but any given cog will either be executing a copy of the Spin bytecode interpreter or a user supplied assembly program. Normally the two can not be combined. There have been a variety of modified Spin interpreters created and posted here by forum participants that allow short pieces of assembly code to be mixed with Spin bytecodes. This has usually been done by using the one or two undefined Spin bytecodes to copy a small block of native instructions into the cog running the interpreter, then executing the copied instructions. Since the Spin interpreter uses essentially all the memory available in the cog, room for the extension is made by moving the instructions for several rarely used interpretive codes into hub memory and using the same copy mechanism to copy the instructions temporarily back into the cog for execution.
Pointer to consist of two words:
First: Start address of the method from the base.
Second: ??? (number of objects).