Prop Spin to ASM compare table
mikediv
Posts: 825
Hey guys I am trying to put together a table that would show the Prop Spin code on one side an the comparable Prop ASM code on the other, so you look at the Spin code say {dira} and the equivalent to the right ASM code I don't know what that is right now..
My question is does this already exist in any form?? If not where could I get the information to help me along I think it would be an easier way to learn ASM if I could see what the Spin code to ASM would be
Thanks
My question is does this already exist in any form?? If not where could I get the information to help me along I think it would be an easier way to learn ASM if I could see what the Spin code to ASM would be
Thanks
Comments
·
if pattern is a fixed number that fits in 9 bits. Or
if pattern is held in a LONG. Similar for outa.
One could say that assignments (eg A := look like:
Or that operators (e.g A := B + C) look like:
Or that conditions ( eg if A = look like:
Best thing is to get your head into the manual and study the PASM section. Try out the examples flashing LEDs and such.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Graham
In the beginning, "BS2 Functions" helped me to go from Basic Stamp to the Propeller, and some basic SPIN functions translated to PASM couldn't harm.
Heater did a good start and here is an idea of some more:
REPEAT WHILE ...
REPEAT x FROM 0 TO 10
IF ina[noparse][[/noparse]0] or [noparse][[/noparse]0..7]
WAITCNT[noparse][[/noparse]...]
ctra[noparse][[/noparse]30..26] := %00100 'NCO mode
Also some BS2 functions that could be handy in PASM:
RCTIME
PULSIN
PULSOUT
SERIN
SEROUT
SHIFTIN
SHIFTOUT
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does that byte of memory hold "A", 65, $41 or %01000001 ?
Yes it does...
·
one way to do REPEAT x FROM 0 TO 10
Post Edited (Graham Stabler) : 12/7/2009 4:39:55 PM GMT
Setting CTRA
,,,, Thanks again guys I am going to use your examples and start my conversion table I understand now there will not always be a code to code conversion so I think I will use examples when I have to showing Spin code to comparable ASM code
If anyone wants to continue to join in I will post the completed list here when its more complete and maybe people would liek to add to it. Thanks again ,, Happy holidays to everyone have a safe and happy thanksgiving
Still, you have a valid point, a bunch of PASM examples demonstrating common programming constructs could be useful to many. Loops, conditionals, etc.
Some one please put up an example of the tricky one in PASM, array indexing !
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (Graham Stabler) : 11/26/2009 9:18:12 AM GMT
I think you loop is adding the #lookup_ offset each time through the loop. I think the :loop label should be on the next line down.
Also, you need an instruction between the "movs" and the instruction that it is affecting. This is a cache issue.
[noparse][[/noparse]Edit] Graham has fixed the above code. Looks good Graham.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does that byte of memory hold "A", 65, $41 or %01000001 ?
Yes it does...
Post Edited (Bean (Hitt Consulting)) : 11/26/2009 2:50:55 PM GMT
You for sure need an instruction after the movs.
Could probably move the "add index_,#1 " into that position instead of using a NOP.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (heater) : 11/25/2009 7:10:15 PM GMT
I'm annoyed I did not check it more carefully, in some code I'm working on right now I'm reading from a hub array and writing to a cog array, that really was confusing but it worked first time! Well second [noparse];)[/noparse]
Graham
Graham
I do think step-by-step documented (spin-style was nice!) templates is a good kickstart into the PASM world.