Shop OBEX P1 Docs P2 Docs Learn Events
How to learn Assembly - Page 2 — Parallax Forums

How to learn Assembly

2»

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-04-25 20:29
    Yeah, I have Gunther's 2nd and 3rd ed of the SX assembly books, have them almost memorized by now. Personally I think PASM is a wonderful architecture to learn on, especially now that GEAR is around. The SX makes you have to endure all these unatural contortions to make things work, having to use the W register for half of your instruction is a bugger, so is having to deal with banks in RAM and flash. Register to Register flat memory model is so invigorating, so is conditional affect and execution. Even though the SX runs at 50 MIPS and a single cog runs at 20 MIPS, I think a serious case could be made that the cog's effective throughput when compared to the SX and how it does things as being pretty much equal, and this isn't even·counting the whole 8 bit vs 32 bit issue.

    There is truth to the comment that once you learn how to program in one assembly language, you can learn to program in another. But the PASM can be addictive. I have a project Im just starting that I'll use the Propeller to develop, then if we decide to base a product on it I'll migrate it to the SX. If this happens, it will be the first program I will have written for the SX since Feb 2006 when I received my Propeller Demo Board.

    The most successful foundation for anyone wanting to learn how to program in assembly (and to become a successful programmer in any language) is to get a book on computer math and understand inside and out how computers crunch numbers (binary logic, two's compliment, the whole bit). First this knowledge is essential if you plan on doing any serious assembly coding, second it makes you a better all around programmer because when you understand how the hardware does things, you can write better software. A good example is if you need to multiply a number by 4, instead writing x*4 or writing the assembly code for general multiplication, you instead code it as x<<2 and you will achieve the same result in a fraction of the time on the majority of architectures out there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 4/25/2007 9:35:18 PM GMT
  • Max WoodenMax Wooden Posts: 112
    edited 2007-04-25 20:44
    Paul, do you have any recommendations on books on computer math?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Max Wooden
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-04-25 21:10
    Well all my books on the subject are college textbooks and at the price they go for, I wouldn't ordinarily recommend them. However I was poking around amazon's collection and truckwiz (Brian Beckius) from our forums recommends this book.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 4/25/2007 9:20:30 PM GMT
  • Max WoodenMax Wooden Posts: 112
    edited 2007-04-25 21:57
    Thanks a lot, Paul, looks like a good book.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Max Wooden
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-04-25 22:54
    I have bought many new & used·text books on ebay and always at great ebay prices.

    Thanks for the advice Pual.

    Seems like there is always a borring chapter within a technical journal,·on the most basic subject, that in the right hands will make everything just Click!. Will you post your books too? and I'll keep an eye-out on ebay for them.
  • Nick MuellerNick Mueller Posts: 815
    edited 2007-04-25 22:59
    I don't know what's so special about assembler. It is just another language in the list. Very few instructions , simple syntax and by several magnitudes less complex compared to C++.
    If you know a few languages, you'll learn this one too. Just the same way you learned the other languages.

    Think positive! Play around! And don't say: "Oh my god, it's assembler"

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-04-25 23:09
    I believe my introductory textbook was this one but the third edition,·I have to compare the authors with my copy at home to make sure it is the same series. If it is, it looks like the used version of the 4th edition are a steal (~$3.00). Understand that this is a college level textbook, so it will be relatively dry with much less hand holding.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 4/25/2007 11:14:08 PM GMT
  • crgwbrcrgwbr Posts: 614
    edited 2007-04-25 23:46
    Thank Paul,
    I'll probable get the first book you recommended. That should help a lot.

    Craig

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I would love to change the world, but they won't give me the source code

    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-04-25 23:51
    I have Gunther's 2nd and 3rd ed of the SX assembly books said...
    Hmmmmmmmmm........., maybe just an honest mistake??
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-04-26 00:32
    I have coded up steps one and two, I feel fairly happy with them:

    http://forums.parallax.com/showthread.php?p=647408

    I recommend it as an excersize!

    Graham
  • potatoheadpotatohead Posts: 10,260
    edited 2007-04-26 03:59
    These are great!

    Learned something new already! Parameter passing is clean and easy to see.
  • crgwbrcrgwbr Posts: 614
    edited 2007-04-26 11:42
    Wow, thanks Graham.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I would love to change the world, but they won't give me the source code

    People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.

    I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"
Sign In or Register to comment.