Shop OBEX P1 Docs P2 Docs Learn Events
What is the best way to learn Spin Code or Assembly Code — Parallax Forums

What is the best way to learn Spin Code or Assembly Code

sam_sam_samsam_sam_sam Posts: 2,286
edited 2008-07-09 11:44 in Propeller 1
Hi Every One

July 3 was the last day at my job

Now·I have a lot more time to spend more time to learn something new

I have read the Propeller Manual and have been·reading·the Beginners Spin Code Examples and Assembly Code for Beginners

I see I have a lot to learn

Not all of it do·I understand·so it take some time for me·get enough of an
understanding to able to write a simple code

Which one should·I start with Spin or Assembly and why ???

I would like to get some ·idea.gif·s from the people on the Forum






▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·idea.gif·that you may have and all of your time finding them

·
·
·
·
Sam

Post Edited (sam_sam_sam) : 7/9/2008 11:48:13 AM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-09 01:00
    Start with Spin. Get the Propeller Education Kit tutorials and work through them. When you feel like learning assembly, start with the use of GEAR. It's a simulator that will let you try out things and watch what's happening inside the Propeller.· Work through DeSilva's tutorial.
    ·
  • Forest GodfreyForest Godfrey Posts: 38
    edited 2008-07-09 01:02
    I would suggest starting with Spin. You have to include a bit of Spin to get to assembler anyway. From there, you can get a pretty good feel for the I/O interfaces in the Prop. One warning on Spin - the comparison operators are really tricky if you come from a C background. Some are the same and some, like not-equal, are totally different... That will probably continue to trip me up as long as I use the language...

    I tend to be able to pick up assembler languages relatively quickly. Prop assembly took a bit longer. Key differences from a "normal" RISC-ish assembler that threw me for a bit are 1) it's a two operand, not three operand language so the first source argument gets overwritten and 2) the lack, or abundance (depending on how you look at it) of registers. Basically, the 2k of Hub RAM is treated as both RAM and registers, and can only be addressed as 32 bit "long"'s. Related to #1, you don't get register-indirect addressing in 2-operand assemblers (well, not any that I've seen). One other warning for Assembler programming:
    mov foo, #0 ; Move the number 0 into "foo"
    mov foo, 0 ; Move the contents of register/address 0 into "foo"

    Confusing the second for the first is, well, confusing to debug later [noparse]:)[/noparse]
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-07-09 01:16
    Mike Green and Forest Godfrey

    Thank You for your replies

    I will work through the Propeller Education kit tutorials first and go from there




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 7/9/2008 1:22:37 AM GMT
  • DgswanerDgswaner Posts: 795
    edited 2008-07-09 01:18
    Get an LCD display, a prop plug and a proto board. I'd start with one sensor type and get it working with a pre-built object, get it working then tweek the code, then go to the next sensor....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-09 01:29
    I don't know what kind of Propeller board or kit you have or are planning to get.· The Demo Board is really handy for small experiments and, best of all, you can attach a TV to use for debugging and experimentation.· It's much more fun to use than a simple serial LCD display in that you can do graphics as well as text.· I've also used a PS/2 keyboard for entering data for testing.· It's so easy to use the existing objects from the Object Exchange for the TV and keyboard.· If you decide to get a Protoboard (or even if you do get a Demo Board), you can also use a VGA display the same way.· You do get a larger screen and a crisper image, but the cable is thick and the display is large compared to a mini-TV of some kind.

    Do use FemtoBasic for some experimentation.· You can use it with a TV or VGA display and a PS/2 keyboard and you have access to the cog counters and all the I/O pins.· If you want, you can use the DongleBasic version with your PC as a console using the programming port.


    Post Edited (Mike Green) : 7/9/2008 1:34:59 AM GMT
  • hippyhippy Posts: 1,981
    edited 2008-07-09 02:12
    Definitely start with Spin and I'd say get TV or VGA working and play with that first; you'll likley find it invaluable for debugging later.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-07-09 11:44
    hippy ,Mike Green, Dgswaner

    Thank You for all of your replies and ·idea.gif·s

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
Sign In or Register to comment.