Cog Memory

Cog RAM is similar to Main RAM in the following ways:

  • Each can contain program instruction(s) and/or data.
  • Each can be modified at run-time (example: variables occupy RAM locations).

Cog RAM is different from Main RAM in the following ways:

  • Cog RAM is smaller and faster than Main RAM.
  • Cog RAM is a set of "registers" addressable only as longs (four bytes) while Main RAM is a set of "locations" addressable as bytes, words, or longs.
  • Propeller Assembly executes right from Cog RAM while Spin code is fetched and executed from Main RAM.
  • Cog RAM is available only to its own cog while Main RAM is shared by all cogs.

Once assembly code is loaded into Cog RAM, the cog executes it by reading a long (32-bit) opcode from a register (starting with register 0), resolving its destination and source data, executing the instruction (possibly writing the result to another register) and then moving on to the next register address to repeat the process. Cog RAM registers may contain instructions or pure data, and each may be modified as the result of the execution of another instruction.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.