Shop OBEX P1 Docs P2 Docs Learn Events
Trying to learn Assembly , heres some helpers — Parallax Forums

Trying to learn Assembly , heres some helpers

Brian_BBrian_B Posts: 841
edited 2006-12-30 00:33 in Propeller 1
Hi,
·I had sombody message me about assembly programing , here's some stuff that I found helpful.

Brian

http://www.atariarchives.org/mlb/
www.diycalculator.com
www.emu8086.com
www.oshonsoft.com·· -8085 & pic eluminators
the sx-key system is prettycool for learning assembly & of course the propeller· , I've included my little assembler program to show the effects of each code.


Post Edited (Brian Beckius) : 12/28/2006 3:07:33 PM GMT

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-12-28 15:29
    I wish there were a good universal 'proforma' approach to assembly, but I have my doubts.

    I chose the SXes because --
    1. RISC - reduced instruction set, which means learning the least amount of instructions and making them do the most.
    2. Virtual Peripherials, which means learning to have exactly what you want as I/O interfaces in firmware rather than buying a different flavor chip everytime you want to do something a bit different [noparse][[/noparse]better known as the PIC downfall].

    I am not sure the 8086 and 8085 is very useful. After all those are not Harvard architecture micros, they combine program and data in one memory - VonNeuman architecture.

    Try www.piclist.com and www.sxlist.com for a wealth of useful stuff. The best of RISC examples. You can learn a lot from porting PIC programs to SX and have access to a huge amount of material at Microchip for ideas and background. Please be aware the Microchip does provide some examples that it claims are only licensed for used on PICs, like automatic baud recognition. But at least you can take your creativity and fully comprehend the power of assembler - even if you cannot use those things without Microchips blessing. Of course, Parallax is not so stuffy about knowledge.

    The PIC and the SX are RISC and that means the Data and the Program memory are kept seperated. It is important to understand this because and ORG statement [noparse][[/noparse]originate statement] for any address can go towards two different destinations that are simply dependent on the context of the code. At first it may be a little scary, but Guenther's text really spells it all out in 'baby steps' that help one notice the pitfalls along the way.

    That may seem hard, but it is actually harder to interleave the two and keep things tidy in tight quarters. You end up doing a lot of calculation and recalulation of addresses [noparse][[/noparse]That is why Microsoft included the binary calculator in Windows.] If you overwrite your program with data by mistake, all is lost.

    The Propeller Assembler is a whole different think. Memory allocations for program sit in COGs while 'usually' data would sit in the main RAM. Still, that is more like traditional RISC than VonNeuman. So learning the SXes seems to be a useful step to learning to program Propeller Assembler.

    Of course, once you really become expert in one Assember; variety is the next challenge. I just think the SXes have been making the journey more enjoyable for me. Less runs to the store for more parts and more hours of pondering how one little IC is really so flexible.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 12/28/2006 3:34:42 PM GMT
  • BTXBTX Posts: 674
    edited 2006-12-28 17:20
    Thanks so much Brian.
    I fact I can solve my problem (This is in another post), reading your code, I've it in my computer...I don't know when I download it.
    Now reading this thread, I download the "assembly_1.spin" code, and I see that is the same...I understand perfectly what do you do in it, and I can found the errors in mine.

    Regards.
    Alberto

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • OwenSOwenS Posts: 173
    edited 2006-12-29 11:59
    Kramer said...
    I wish there were a good universal 'proforma' approach to assembly, but I have my doubts.

    I chose the SXes because --
    1. RISC - reduced instruction set, which means learning the least amount of instructions and making them do the most.
    2. Virtual Peripherials, which means learning to have exactly what you want as I/O interfaces in firmware rather than buying a different flavor chip everytime you want to do something a bit different [noparse][[/noparse]better known as the PIC downfall].

    I am not sure the 8086 and 8085 is very useful. After all those are not Harvard architecture micros, they combine program and data in one memory - VonNeuman architecture.
    And this differs from the Propeller how? I would describe the prop as Von Neuman also. Additionally, looking at a CISC processor can be useful
    Kramer said...

    Try www.piclist.com and www.sxlist.com for a wealth of useful stuff. The best of RISC examples. You can learn a lot from porting PIC programs to SX and have access to a huge amount of material at Microchip for ideas and background. Please be aware the Microchip does provide some examples that it claims are only licensed for used on PICs, like automatic baud recognition. But at least you can take your creativity and fully comprehend the power of assembler - even if you cannot use those things without Microchips blessing. Of course, Parallax is not so stuffy about knowledge.

    The PIC and the SX are RISC and that means the Data and the Program memory are kept seperated. It is important to understand this because and ORG statement [noparse][[/noparse]originate statement] for any address can go towards two different destinations that are simply dependent on the context of the code. At first it may be a little scary, but Guenther's text really spells it all out in 'baby steps' that help one notice the pitfalls along the way.
    Wrong. RISC in no way implies a Havard architecture. Berkely RISC wasn't. MIPS isn't. SPARC isn't. ARM isn't. PowerPC isn't. PIC and SX are Havard because it makes sense in most micro controllers. But most RISC architectures are Von Neuman.
    Kramer said...

    That may seem hard, but it is actually harder to interleave the two and keep things tidy in tight quarters. You end up doing a lot of calculation and recalulation of addresses [noparse][[/noparse]That is why Microsoft included the binary calculator in Windows.] If you overwrite your program with data by mistake, all is lost.
    I've done large ammounts of low level programming on Von-Neuman architectures and never had this issue. Sure, it's possible. But if you have that kind of bug, your data is probably trashed anyway and IMO it's better to crash than start behaving in a potentially dangerous way
    Kramer said...

    The Propeller Assembler is a whole different think. Memory allocations for program sit in COGs while 'usually' data would sit in the main RAM. Still, that is more like traditional RISC than VonNeuman. So learning the SXes seems to be a useful step to learning to program Propeller Assembler.
    Berkely RISC IS Von Neuman! So is the Propeller. Yes, data regularly sits in shared ram on the Prop. This still does not make the prop a Havard Architecture!
    Kramer said...

    Of course, once you really become expert in one Assember; variety is the next challenge. I just think the SXes have been making the journey more enjoyable for me. Less runs to the store for more parts and more hours of pondering how one little IC is really so flexible.


    RISC has NOTHING to do with the memory access model. RISC has to do with reducing the number of instructions, to make creation of a fast processor easier (Less gates on instructions = Deeper pipelining possible)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-12-29 18:16
    Now I understand, RISC is not Harvard or VonNeuman.
    And the Propeller is not Harvard, but has two separate RAM locations [noparse][[/noparse]I did some follow up reading as I suspected I was getting into the weeds.]

    For those of you that have been in the industry since the 80s or earlier, it is easy to have clarity.

    In my case, I have been revisiting digital after ignoring it for decades and books are no longer written with the kind of overview that was provided way back then. Mike Preko's comparitive text of Microcontrollers is out of print and I suspect that the chip manufacturers told him to stop supporting it because they didn't want comparison and overview. After all, what is a techincal author to do without support from the manufacturer?

    The above Atariarchives reference· provides a wonderful book, Machine Language for Begineers. But it is presenting the 6502 as context. It would be wonderful if a similar book was written with SXes or the Propeller, but I have my doubts that there is an audience that would justify it. Also, Parallax keeps its crew quite busy just documenting what they have. Everything I am reading requires I continually stretch to get an overview.

    With the Propeller, everything is so new that I just had to make a guess. After all, there really isn't much detail of the microprocessor's architecture in what has been provided so far. I am sure it will come with time. The Hydra text is a big assistance to seeing the Propellers full resources.

    For some one that is somewhat new to all this, it is hard to find a genuine 'front door'.

    So, beginners and intermediates are faced with either going back to school or trying to extrapolate principles from older texts and apply them to new technology. It is hard to do. After all the 6502 was VonNeuman and dependent on external I/O chips. And it certainly didn't have video generation included in the microprocessor or flash serial EEPROMs.

    I suppose this is why some electronics buffs stay strickly with audio tube amps. The feel more confident that they can learn it.

    Nonetheless, I really am enjoying the challenge and it doesn't matter if I look like a fool if other learners are finding needed-to-know information in your comments. It is all intended to be with goodwill and enjoying the fellowship as much as the project.

    So, please forgive me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "If you want more fiber, eat the package.· Not enough?· Eat the manual."········
    ···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Brian_BBrian_B Posts: 841
    edited 2006-12-29 20:46
    HI,

    Don't feel bad I'm still trying to figure out the propeller. Example , did you know that each cog has it's own c & z register's , good luck finding them on the "Data sheet" .

    Brian
  • ObliowObliow Posts: 4
    edited 2006-12-30 00:33
    As a note,

    TI TMS320C6xxx , Parallel pipelined DSPs (which I believe are also RISC) are also Harvard architecture. Not to say that RISC == Harvard, but to provide another datapoint.
Sign In or Register to comment.