Assembly or spin?
p00ndawg
Posts: 70
which would be better an intermediate to advanced programmer?
What kind of functionality do you lose if you write code in spin or assembly?
What kind of functionality do you lose if you write code in spin or assembly?
Comments
Assembler is limited to 496 words max per cog but it's all about speed, not so much functionality, isn't it(?). For instance, you can write a serial communications driver in Spin that will work up to 19.2K baud but if you do it in assembler then it can run a whole lot faster. Of course these comments are just general, you could get specific, but they cover you questions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Also, it is possible to write code that combines spin and properly assembly correct?
Spin uses up the whole cog just to run the spin language.
It gets spin instructions from the hub ram and executes them.
You run spin in one cog and use it to launch an asm program
in another cog.
The propeller chip can have asm and spin running at the same time of course.
It's just that they need to be in their own cogs. They can easily communicate
by passing data using the hub memory.
This is one difference between the propeller and other controllers.
Another is that there are no interrupts, you can simulate them if
you want to, it's easy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Visit some of my articles at Propeller Wiki:
MATH on the propeller propeller.wikispaces.com/MATH
pPropQL: propeller.wikispaces.com/pPropQL
pPropQL020: propeller.wikispaces.com/pPropQL020
OMU for the pPropQL/020 propeller.wikispaces.com/OMU
pPropellerSim - A propeller simulator for ASM development sourceforge.net/projects/ppropellersim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Another thing to note, spin uses more efficient use of your hub RAM than assembly because it's tokenized. Every assembly instruction takes 4 bytes no matter what it does. So you may be able to do the same thing in spin with less memory.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"A government big enough to give you everything you want, is big enough to take away everything you have. "
- Thomas Jefferson