Spin Semantics
g3cwi
Posts: 262
The Spin language provides several ways of doing some things:
A := A + 1
A += 1
A ++
To my tiny mind, the first is the most readable. Is there any runtime penalty for writing the more intuitive form here or elsewhere?
Cheers
Richard
A := A + 1
A += 1
A ++
To my tiny mind, the first is the most readable. Is there any runtime penalty for writing the more intuitive form here or elsewhere?
Cheers
Richard
Comments
Check out this thread as well: [post=1063920]Spin speed up[/post].
It awful slow 50 to 100 times slower than executing native PASM instructions. But has the benifit of making smaller code which is important on the memory constrained Prop with its 32 bit instructions. Also gets around the Problem that the Prop can only execute native code from within its COGs which are only holding 496 instructions max.
It turns out, yes. The examples you cite consume 656, 576, and 336 cycles, respectively. One of the [many] neat things about the Propeller is that it can time itself using the CNT register. See the attached program.