Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Assembly — Parallax Forums

Propeller Assembly

microcontrollerusermicrocontrolleruser Posts: 1,194
edited 2017-10-13 16:24 in Propeller 1
I looked at some kind of FAQ for Propellor Assembler.

http://www.parallax.com/propeller/qna/Content/QnaTopics/QnaAssembly.htm

Well. It does have MOV opcodes like assembler.

Okay. I will take a look at it.

Might as well do something with our stockpile of Propellor hardware.

Everybody stay away from those Quickstart Human Interface boards on sale until we get one. :smile:

Comments


  • Already have a question.

    Can you have ALL the processors working on one task?

    That is one thing that's been bothering me about this. How do you 'pour on the power?'.

    I don't want a bunch of 10F200's.Then be limited to that kind of power.
  • Heater.Heater. Posts: 21,230
    Depends what you mean.

    Most often Propeller applications have one top level Spin object running the users program in one COG. That object then makes use of all kind of drivers and things running in other COGS to get the interface work done that it needs. UART, SPI, SD card file system, etc, etc. Or whatever sub-functionality you like.

    On the other hand if you have a computation that can be split over many COGs to gain performance that is also possible. For example I have a Fast Fourier Transform that can run on 1 COG or make use of 2 or 4 COGS if you need more speed. It's written in C mind you.

    It's just a matter or programming :)
  • JonnyMacJonnyMac Posts: 9,104
    edited 2017-10-13 19:57
    Of course -- and as I actually implement, I can give you a real-world example from my life in entertainment. Have a look at this image:

    2b5919277770039393f6e2be49ce64dd.jpg

    If you're a gamer, you might recognize Annie and Tibbers from the Riot game, "League of Legends." There are several hundred 2W LEDs running to create flames (Tibbers' seams) and burning embers (trees) lighting effects. At the heart of this is a single Propeller in the form of an EFX-TEK HC-8+ controller (yes, I designed it, with the PCB layout done by John Barrowman, another former Parallax employee). The HC-8+ is acting as a DMX master controller sending lighting data to a bunch of off-the-shelf DMX bricks; those are what drive the LEDs.

    Cog assignments:
    -- main cog launches everything and controls Tibbers' eyes
    -- one cog controls a flame in Annie' hand (lights her face)
    -- flames cog for Tibber's seams
    -- four cogs for embers (one per tree; overkill, but I had the cogs)
    -- DMX output driver

    My DMX driver exposes the address of the DMX transmit buffer. This allows the embers and flames cogs to write into that buffer, directly to the channels they affect (using bytemove to do it quickly). By using this strategy, I could enable/disable any particular aspect of the animation; this is critical when working for Steve Wang who is a Hollywood effects legend. He mostly expresses what he wants from me in hand-gestures and sound effects from his mouth. After eight years of working with him, I know what he means. This is just one of the many displays we've created for Riot. We've also done displays for Blizzard. The power and flexibility of the Propeller allows me to craft animated lighting that matches the scope and grandeur of the displays -- and often with very little time to do it.

    You can see a bunch of my other artist implementations on this page: https://www.pinterest.com/jonmcphalen/techno-art/

    I don't want a bunch of 10F200's.Then be limited to that kind of power.
    This is a ridiculous comment.
  • TorTor Posts: 2,010
    It's Propeller btw, not Propellor.
  • VonSzarvasVonSzarvas Posts: 3,450
    edited 2017-10-13 16:33
    Hello @microcontrolleruser

    Check this thread for a great offer on Harprit's PASM book.

    forums.parallax.com/discussion/comment/1418441/#Comment_1418441

    Ps. I've edited your thread titles for you with a spelling update. It's Propeller, not Propellor. Using the correct spelling helps search.

  • 'have a computation that can be split over many COGs to gain performance '

    Gain or get performance. Yes.

    'make use of 2 or 4 COGS if you need more speed.'

    How about 'locking down' all eight?

    But.This is a hobby so. Off we got to light an LED with Professional Board.

    Nice to talk 'what if' though.
  • Heater.Heater. Posts: 21,230
    microcontrolleruser,
    How about 'locking down' all eight?
    Generally because when splitting a compute intensive task over multiple cores/COGs the performance does not scale linearly with number of cores. 2 cores is not twice as fast as 1, 4 cores is not twice as fast as 2. It's a case of diminishing returns. See Amdahl's Law: https://en.wikipedia.org/wiki/Amdahl's_law#References


  • blittledblittled Posts: 681
    edited 2017-10-13 19:14
    Buried deep in the forums is deSilva's document on PASM. I googled it and found another link for it: https://cp.eng.chula.ac.th/~piak/project/propeller/machinelanguage.pdf

  • Found Blink LED tutorial probably Spin.

    http://learn.parallax.com/tutorials/language/spin/get-started-propeller-board-education/2-led-light-control/led-light-control

    Look at the last words in lesson.

    'Check for blinking light'

    Nice to be back with Parallax.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2017-10-13 19:29
    'Buried deep in the forums is deSilva's document on PASM'

    That is what I was thinking. If PASM is Propeller assembly.

    I did a quick search and no Assembly Manual jumped out at me.

    Let me do a little Spin coding first.


  • Found the Assembler Manual.

    https://www.parallax.com/sites/default/files/downloads/P8X32A-Web-PropellerManual-v1.2.pdf

    Half the manual is Spin. Page 238 to end is Assembler.

    I like the part 'Where does an instruction get it's data?'

    Well yes. That might come in handy.

    Good ol' Parallax.

  • Von Szarvas

    'https://www.amazon.com/Programming-Propeller-Spin-Processing-Electronics/dp/0071716661'

    I get it.

    The guy that wrote this also wrote a self published guide to Assembler.

    Are you telling me 'no parallax assembler lessons'?
  • There's plenty of high-quality, well-commented PASM code out there you can study. That is how I learned PASM.

    The Propeller Manual has a whole chapter on Spin and a whole chapter on Assembly. It's a great reference. A PDF of it comes with Prop Tool, but can also be found at the link below:

    https://www.parallax.com/sites/default/files/downloads/P8X32A-Web-PropellerManual-v1.2.pdf

    You can also buy the printed edition, which I would highly recommend.
  • Every opcode has a purpose. To paraphrase Feynman, "If you think you understand why an opcode is unneedful, you don't".

  • Jon

    Thanks for those two tutorials.

    Propellor Tricks and Traps looks good too.

    Bob


  • Doing C Learn now.

    http://learn.parallax.com/tutorials/language/propeller-c/propeller-c-start-simple

    It's all the same. Just have to remember which one you are using. :smile:
  • The following are examples in Propeller Assembly:
    MOV $1F4, #$FF 'Set OUTA 7:0 high
    MOV OUTA, #$FF 'Same as above
    The following are examples in Spin:
    SPR[$4] := $FF 'Set OUTA 7:0 high
    OUTA := $FF 'Same as above
    

    Tidbit from Propellor Manual.

    Looks like Propellor IDE was written outside of Parallax.

    Propellor Tool written by Parallax.

    Probably bounce between the two.
  • Spell check. It's Propeller not Propellor.
  • JonnyMacJonnyMac Posts: 9,104
    edited 2017-10-15 18:15
    Propeller Tool was written inside (Jeff Martin).

    PropellerIDE was written outside, with direction from Parallax (and suggestions from vocal users like me!). It is actually a fork of SimpleIDE, but tailored for Spin. I prefer the editing features of Propeller Tool, in particular, smart tabs, blocks selections, and the way search/replace is handled. But... the compiler built into Propeller Tool doesn't do unused code removal an I have some big projects that it cannot compile. I use PropellerIDE to compile those projects that are too big for Propeller Tool.

    I do like that PropellerIDE supports multiple templates while Propeller Tool only allows one. Due to the number of platforms that I write code for, having templates saves a lot of time. I often create a project in PropellerIDE, do the editing/debugging in Propeller Tool, then -- if required -- do the final compilation in PropellerIDE. It just goes to show that there is no on tool that is perfect for everything.

    FWIW, I find it best to write obvious code. It's a very rare case when anyone refers to the SPR array, especially when all of the elements have names known to the compiler.

  • Jon

    Coming around to using Spin at the get go.

    Should have some code samples soon.

    'Propeller Tool doesn't do unused code removal '

    No big. If anything is removed from my code there would not be anything left.
Sign In or Register to comment.