Prop Assembly - ground up
ALIBE
Posts: 299
I am trying to start w/ prop asm. CAn someone recommend a good set of resources for both asm and prop asm instr for beginners. I have RAndy Hyde's art of asm book - but, not very impressed w/ hla.
thanks
Nagi
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
http://fstop.crosscity.com/
http://icar.crosscity.com/
·
thanks
Nagi
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
http://fstop.crosscity.com/
http://icar.crosscity.com/
·
Comments
The reason I ask, is there aren't really any well suited "Assembly for Beginners" text that I am aware of outside of a university bookstore. Assembly by it's nature varies wildly depending on the platform, which means books are written for a particular platform. The Propeller's assembly diverges considerably from the platforms typically used to teach assembly (Motorola's 68K and Intel's 8051).
My advice is if you are serious enough about learning it, you'll slowly pick it up. Read, re-read and read again chapter 5 of the Propeller manual. Sleep with it under your pillow if you think osmosis will work. Start with the program page 340 of the manual and tinker with it until you understand whats going on, then try to expand on it in incremental steps. I will be releasing an application next week (functionally its done, all thats left is some touching up). It has a few assembly routines within it and every line of code has comments, read it until you understand it. Look at every object that contains assembly·and try your best to follow whats going on (though this probably wont be much help until I get to expanding the comments within them).
I first learned assembly on the Tandy Color Computer, I bought the companion book that explained (in technical terms) the assembly language for the computer. I took the book wherever I went, and read it until the spine broke and pages started falling out. I wrote maybe two programs on the platform and most of the concepts of programing assembly didn't gell until the immersion by fire in college. IOW it is quite a steep learning curve for most people.
If somone knows of a commonly availible book for learning assembly, please chime in.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 9/16/2006 1:32:55 AM GMT
start by just reading through the manual to get a grasp on how the instructions affect the data
think about how they combine to form the operations that we've all become acustomed to
add in the conditional execution and flag/result effects
and finally the timing event instructions
Basically just play around with it, adding complexity as you become comfortable with it
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
But seriously, the Propeller's as good as any processor to start on. Don't waste your time looking for general assembly language how-to books, though. Just dig in, and get your hands dirty. Read other people's code. Try to figure out what they've done. Modify their code and see what happens. Blink some lights. Make a game of it, and have fun playing.
And, above all, don't take too much of what you learn for granted if you're ever called upon to program an 8051!
Good luck!
Phil
My interest is purely out of curiosity rather than by need.
Nagi
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
http://fstop.crosscity.com/
http://icar.crosscity.com/
·
Just joined the forum because I'm looking hard at getting a Prop system running. What an interesting piece of hardware! My interest is at the hobby level for now. I really enjoy working on older, simpler hardware. I saw this as a modern alternative that appears to have all the fun elements, while not having anywhere near the limitations.
Saw this thread and wanted to comment on Assembly language learning. I learned on the 6502, then 6809, then some Intel after that. (--still have my tattered Moto data book, for 6809.)
The advice given here, for beginning the assembly learning process is solid. One thing I want to toss out here is something my mentor had me do long ago: print out an assembly listing that is not too long. Get a set of highlighters and color code each instruction as to it's overall purpose. Jumps, data transfer to I/O, calculation, branch (well, lots of instructions can be either executed or not on this chip, so maybe color them as to wether or not they are supposed to execute often or not so often, and or by type.), also color data -vs- addresses as these appear to be in different placement for some classes of instructions.
(Why was this, BTW? Seems to add a layer of confusion to a fairly rigid structure. I'm curious about this.)
From this, you will see subroutines and data areas emerge, finally giving you a better picture of the routine as a whole.
This worked very well on the older CPU's as it helped to assemble the clues each instruction provides as to function, while keeping focus. (IMHO, the distractions and tangents make things difficult.) It's an old technique, but it seems to work well for relating instructions to functions for me. The goal is to become familiar with the core elements of the program listing, thus freeing you up for the higher level interpetation necessary to begin to really work with the system.
Take it for what it's worth.
Regarding this particular assembly language, I find the listings so far very intriguing. The ability to set conditional execution as a parameter really helps to pack things in, thus making the most of every instruction. (I really want to call, what I would think of as an opcode, something more like an instruction set.)
The fairly steep instruction limits at first turned me off, but after looking at the fragments posted so far, it's obvious that far fewer instructions are needed to accomplish something than would otherwise be required on many other CPU's. Should be a fun ride.
Don't put assembly programming on a pedestal, it is "just" moving numbers around between registers. The manual does a good job of explaining what the commands do and examples can show how to use those commands, your own applications will provide a good driving force to actually learn something. Rather than just reading you think "how can I do this" and then you look into it.
The sticky thread with the assembly examples should be a good start, if you don't have the manual then print out the assembly chapter and bind it somehow or just have the PDF open and use the search facility.
Be patient and just get stuck in.
Graham
Graham, I looked at the ASM for beginners sticky thread. What I don't find in there is a "code walk-thru" or a "step-by-step" examples that help teach asm in prop. I am looking for something that is similar to the spin examples in the manual's first half - only in asm. Do you know if and where they might be found in this forum?
thanks both, Nagi
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
http://fstop.crosscity.com/
http://icar.crosscity.com/
·
Good question, though starting to get OT for this thread.
Guess it comes down to this: The prop is really different and very flexible. Having to invest a little to get a hobby system running is no biggie really. The learning is where the real investment is at. I like multi-cpu systems a lot. By day, I do systems engineering and administration. My years working with SGI NUMA systems have largely come to an end, leaving me with mostly Intel system sets running win32 or maybe Linux. (Hopefully more Linux as time goes on!)
While it pays the bills, it's not as much fun these days.
The prop is a very interesting design in this regard, yet it's scale is such that someone interested in computing can achieve their goals without huge investments. The design is a holistic one, with language and hardware melded into one mini-environment. IMHO, that's really new and worth some time learning about. This newness also means we really don't know what it is really capable of just yet. That's attractive for what should be obvious reasons.
Over time, it will be very interesting to see how parallax decides to scale the prop. It's a really unique means of computing.
Post Edited (potatohead) : 9/17/2006 8:31:24 PM GMT
Nagi, as potatohead alluded to, assembly instructions fit into 3 catagories: flow control, data transfer and data manipulation. Flow control dictates the path of execution through the code, in Spin this is the commands IF, REPEAT, CASE etc. Data transfer is moving data from one location to another, and data manipulation is the math that is performed on the data. Understanding these categories and how they fit into an assembly program will help you understand any code that you are reading.
A few topics you should learn (or brush up on if you already know them) is logic equations, binary representation of numbers and 2's compliment notation. Understanding these concepts will help you understand the data manipulation instructions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.