Shop OBEX P1 Docs P2 Docs Learn Events
Question about Assembly Language — Parallax Forums

Question about Assembly Language

MovieMakerMovieMaker Posts: 502
edited 2008-09-11 15:52 in Propeller 1
·If I wanted to write some code for the propeller in asmembly language, I figure I can write it with a simple text editor. Also, there are Spin codes and ASM codes in charts listed somewhere. But, my question is: Once I get the program written in ASM language, does Parallax have a FREE Assembler-Disassembler or do I have to purchase that? And, I plan to follow one of the many guides on the Parallax sight. But, I just wanted to know after I have the code, where do I go from there?· I guess I will end up with a binary file that I will put on the SD card and run it from there.·

. . . . . Just curious.

Thanks!!!· tongue.gif

·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-10 23:00
    The Spin compiler includes an assembler as part of it. The program execution process always starts a Spin interpreter (from ROM). You need to have a "stub" in Spin to launch any assembly program (attached to this message). If you use the Propeller Tool, you'd have a one statement Spin program to start the assembly piece. The "stub" would be used if you were writing an assembler or using one of the assemblers written by forum members.
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-10 23:39
    That is GREAT News!

    Thanks!
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-09-11 01:25
    You need PropTool and the manual - It has a great tutorial to get you started in spin. You can then progress to assembler. I think there are tutorials on the Wiki (someone else can answer that). I suggest you place a high efficiency LED on your test board. I use the Protoboard and have 2 leds - one on pin 24 and one on pin 26. With some careful work you can just place it in the board without soldering for testing. I place it in the pins for the missing 100 ohm resistors, so the LED uses the existing 10K resistors. These are in the PS2 (keyboard and mouse) circuits which are not fitted on the Protoboard. I have details and a program on one of the threads.
    There is another reference - can't remember it's name (@oldbitcollector - what's it called?)



    Post Edited (Cluso99) : 9/11/2008 1:32:29 AM GMT
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-09-11 01:42
    I used one of the connections from the VGA header in "Getting Started with the Protoboard" (below)
    There is more than one usable connection there as well.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with a Propeller Protoboard?
    Check out: Introduction to the Proboard & Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • MovieMakerMovieMaker Posts: 502
    edited 2008-09-11 03:08
    THANKS, GUYS. I will try it.
  • Brian_BBrian_B Posts: 842
    edited 2008-09-11 04:11
    I get more confused everyday, Chip told me that the assembly code gets loaded into the hub as "bite code", when you look the machine codes in the prop tool its backwards, if you peer into the cog memory I think I can see the machine code in there the right way. Chip told me that this was just a fluke and that all code stored in the hub is "bite code". So what is it?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank's Brian




    "Imagination is more important than knowledge..." Albert Einstein

    www.PropelX.com
  • OwenSOwenS Posts: 173
    edited 2008-09-11 15:52
    When you compile Assembly in Prop tool, it's assembled directly to the format a Cog executes. The format is the same as the manual shows.

    However, the manual shows the longs (and words) in "logical format", or big endian. This is the way code operating on longs as longs (and words as words) sees them.

    However, if you operate on a long with words or bytes, or a word with bytes, you find that the bytes are stored backwards. For example, take the number $01_23_45_67. It's stored in memory as $67_45_23_01. The processor flips the bytes arround on the fly when reading longs as longs and words as words.

    The reason for this is that it means that if you access a long as a byte, you can do it as byte[noparse][[/noparse]@longaddr] rather than byte[noparse][[/noparse]@longaddr + 3]

    Whenever assembly operates on longs, it operates on them as if they were in big endian format.

    (The names big endian and little endian come from which byte comes first: in little endian, the least significant byte comes first, and vise versa)
Sign In or Register to comment.