Code for multiple COGs in a single .spin file ?
in Propeller 1
I can write multiple pasm section and launch them into several cogs like this and it compiles, don't know if it runs yet:
Will this work?
How does the cognew() know how much code to load to the cogs?
Or does this result in each cog having all the code?
PUB Main
cognew(@CODE1, 0)
cognew(@CODE2, 1)
' 1st COG code
DAT
org 0
CODE1
' code here
var1 long 0
' 2nd COG code
org 0
CODE2
' code here
var2 long 0
Will this work?
How does the cognew() know how much code to load to the cogs?
Or does this result in each cog having all the code?
Comments
COGNEW always loads 496 longs of code. If your code is shorter, it'll just load whatever comes after into the remaining registers.