PASM 101 for beginners?
Harprit
Posts: 539
I may actually have to learn to use PASM in order to do what I want to do with the Propeller
I'll write it up as I learn if there is a need/interest in a book
What is the real level of interest in a book on this subject.
How many beginners realize that they need to know about binary math and boolean algebra
to be able to really use PASM. A large part of a book could be devoted to just that! Does it
need to be?
Comments please
Harprit
I'll write it up as I learn if there is a need/interest in a book
What is the real level of interest in a book on this subject.
How many beginners realize that they need to know about binary math and boolean algebra
to be able to really use PASM. A large part of a book could be devoted to just that! Does it
need to be?
Comments please
Harprit
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Harprit
You need to be able to go from HEX to Binary and look at bit patterns very quickly. You also have to know your logic tables.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
PASM Primer for the Absolute Beginner*
*The title listed on page 1 is "Assembly Language Primer for the Absolute Beginner."
If you post questions/examples as you learn, most likely you will get feedback from
me and others. A healthy discussion of the topics at hand will make the result better.
It will serve as a learning experience for us all I'm sure.
If you can understand GEAR mentioned in potatohead's tutorial and present a good
description of how to use it effectively, I would certainly appreciate it since I don't get it.
There are various debuggers that can help you along the way. I use mine [noparse]:)[/noparse] which
is text based and allows for multiple COG interpreted stepping, animation, instruction
watch, break, and real-time breakpoints. It is effective when used with BST .list files.
My debugger HUB footprint moderate, and I use it developing the Propeller JVM.
I have also used PASD which has a reasonable GUI and most people here have used.
PASD is a friendly program and has a small overall HUB footprint.
Cheers,
--Steve
Ha! Either you know it or you don't!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
Post Edited (jazzed) : 6/22/2010 5:47:07 PM GMT
I even wrote a few pages of one myself a few months ago.
But I'm not a good writer and the result was so poor I'd be
embarrassed to show it.
I had decided to write a small .pdf about basic computer math
so that anyone who needed it could download it. Might be a good
way to go if you decide to write something. Someone else has
probably already written such a math primer, so you might be
able to just refer readers to that instead of re-inventing the wheel.
What I see being needed is a blend between just getting started, and the transition to more advanced uses. That's kind of a gap in what we do have online right now. My work being a basic, and DeSilva's actually doing a very solid intermediate / advanced work.
I just noted the comment on Gear. That section needs an update. I used Gear a lot early on, particularly when I was unable to get access to a Propeller on the go. It's quite useful for learning a lot about PASM. That's been moved to the top of the list, along with the errata people have sent me this last coupla weeks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Wondering how to set tile colors in the graphics_demo.spin?
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 6/22/2010 6:33:03 PM GMT
Then·detailed explanations of the *hardware* for each gizmo and functional diagrams like in this document for the counters...
AN001 - Propeller Counters v1.0
http://forums.parallax.com/attachment.php?attachmentid=59613
I need to be able to picture or understand what is going on when I set a particular bit to 1 in a register. How that "rewires" the circuits so certain things then happen.
Once I understand "how it works", then I can program away. (I like to look at the pictures )
http://www.youtube.com/watch?v=_5zRxYyfDN0
Self Modifying code is normally frown on, but with prop is a must.
Good idea to put 0-0 there, just to show that this number is changed when the program is run.
But make sure you do not·modify the code·one line·just below, insert a nop if needed.
AND, OR and·XOR are all bit logic.
Use the windows calc program in programming mode with Dword selected to view decimals as binary.
What is asm code instructions·and what is actually just label names (place holders) can be a little confusing first.
If you always start label names with an uppercase letter would be·good.
Some math is done when the proptool assembles the code.
The Pin label above shows "<<21",
that means left shift it 21 spots up and that the proptool calculates before that number is included in the code.
Post Edited (tonyp12) : 6/22/2010 8:42:00 PM GMT
I was told at UPEC that Parallax was working on a PASM tutorial. Not sure what the time line is.
FYI: It is generally better practice and more precise timing to add count after setting minimum delay.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
Wish me luck!
Ken
Hex is definitely needed, but don't make the mistake that lots of people do: don't treat hex as a native numbering system. What that means is that you need to remember that the ONLY reason for hex in computers/electronics is for easier representation of binary numbers. Too many people have their students jump through hoops to convert hex to decimal, decimal to hex, hex to base 37 (whatever), etc. That only wastes time for the computer engineering student and does not help them (leave that kind of stuff to the higher math students). You need to memorize 16 conversions/translations (0000 = 0..1111=F) and nothing else (at least not in this context).
Sorry, just that this kind of unnecessary work for students turns them off of the field, and bad teaching is a pet peeve of mine (Don't get me started on teaching Metric - the US Education System did everything in their power to kill our chances at metric by insisting that in order to learn Metric you had to memorize that one kilometer = 1/1.609344 mile, not "about 5 city blocks". And that only exact conversions will work. We learned that a yard is (holding arms out) "about this long"; an inch is (holding the index finger up and pointing from the first to the second knuckle) "abut this far"; we should learn the same way for the meter and the centimeter. Extra, unnecessary, work for students kills their learning.)
Art
Added to update list.
Granz, I would add memorization of the first 16 powers of 2, and the first few powers of 16.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Wondering how to set tile colors in the graphics_demo.spin?
Safety Tip: Life is as good as YOU think it is!
Absolutely! Those are important.
Art
why there being some apparently very good notes on the subject means that there is no need for a
comprehensive book on PASM. Seems to me that the more books there were the better it would be for
the whole Propeller community. There seems to be feeling that somehow the knowledge is to be held close.
We know that we know and we are not really interested in anyone else knowing it. That is the undertone as
I hear it.
Since I myself cannot understand even the simplest examples that are posted on the forum
and in spite of a sincere couple of readings of the Propeller manual am still at a complete loss as
to what the PASM assemblage is all about, it seems to me that there is a screaming need
for a book that takes it from the absolute beginnings for fools like me.
What am I missing.?
There is a need for a book. If there is someone working on it speak up. That not withstanding, I need to
comprehend PASM and it looks like I will have to do it by writing a book.
Harprit.
I am with you on the "can't have too many books to explain things".· I read through just about everything on PASM to get started and from there had to figure out a lot on my own.· There is certainly good information already available - it is just spread out in different places, in different PDFs, in different threads, and just about everywhere.·
If I had the time, I would certainly take the time to write what I can about PASM - i know enough to do what I need to but I don't know anything about binary or hex math or numbers.· From my perspective, a good book that doesn't start with the assumption of "asm experience" or even "C experience" is the basis to begin with.· I have a "BASIC" background and it seems that I can associate PASM with BASIC better than I can with anything else so that is how I look at everything.
If you decide to go down the path of writing a book on PASM - I would gladly help you in any way I can.· I could be a very good "sounding board" for explanations etc.· I have written many programming manuals for industrial controls, but never did anything for regular programming languages.
Let me know if you want help or a sounding board or anything else.· In my opinion, you cannot have too many books covering a subject and furthermore, I believe the real power (speed) of the prop is released with the PASM language.
Chris
Of course there is a need for such a book. But can you write it?
You are clearly able write so that beginners can understand;
however, you don't have enough PASM skill to do it yourself.
There is great risk that you won't able to "get it" any time soon ....
IMHO, you should find a co-writer that actually understands PASM.
Frankly, but very sincerely,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
You are pointing out the obvious problem, only it exists in reverse.· Most of the tutorials I have read so far assume I know more than I do.· This usually comes from someone who has learned the subject to the point of assuming it to be common knowledge.· This is where someone learning it (and who can understand it) can do a much better job of explaining it than the "old pro".
I would assume nothing as that is my starting point and I am sure Harprit would do the same.· What does make it a bit more difficult to do as a "learner" who is writing, is that the subject mater must be understood well enough to write with authority.· That is where the advice of the experienced guys pays off.·
Chris
I am not saying that an amateur can, or should, write a beginners book. But then that is not how I see Harprit. What I have seen of his writing shows that he has a pretty good grasp of the field, he does not appear to be an amateur. The extra effort he puts in to his examples and code commenting will help him to better understand the little that he does not grasp before writing the book. Every author will and should grow through the process of writing a book; writing about new territory will just make the growth that much farther.
Art
P.S. Harprit - don't take this as an permission to slack off, we have seen what you can do and now are holding you to a "higher standard" -
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Wondering how to set tile colors in the graphics_demo.spin?
Safety Tip: Life is as good as YOU think it is!
That way the result can be easy reading and credible authoring.
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
This sounds kind of harsh, considering that those with the knowledge to write such books, well, aren't writing them.
Post Edited (Kevin Wood) : 6/23/2010 8:52:02 PM GMT
If I may....
I knew nothing about SPIN and I think I wrote a damn good introduction the SPIN.
Before David H suggested the book to me I did not even know there was a thing called a Propeller chip.
One reviewer said "This book was flat out amazing!". Not shabby for some one who had to learn SPIN from scratch.
It took me a year. A lot of it has to do with hanging in there and not giving up. Not throwing in the towel. You may
want to take time to think about that. There are some pretty determined guys out there.
Your question as to "But can you write it?" maybe a bit strong because in it is the suggestion that there
may be people who are not smart enough to learn PASM, me being one of them! What a remarkably
interesting idea!!
I may well decide to not publish my notes as I learn PASM but I don't think I cannot learn the language
well enough to introduce others to it.
My expertise is not in climbing Everest. My expertise is determining what it would take to climb Everest. Two
very different skill sets. (Incidentally it maybe of interest to you that I am a "Materials Scientist", not a computer guy).
I will ask for help as I need it and if you can find me a co-author willing to put in the time I am I will be
glad to work with him or her. I hope that you will be able to lend a hand.
Lets see how it goes. The fat lady ain't ready to sing quite just yet!
Mind my mind is still fluid on this one.
Best regards
Harprit
is smart enough to learn PASM. IMO it is simpler than SPIN.
I'm certain Harprit can write this book if he wants to.
Keeping a good notebook that details every step you make
while learning PASM will give you an outline of what the book
should cover.
While I cannot brag at all about my skills of coding in ASM, I was able to figure enough of it out to handle the motion control aspects for my CNC controller.· In some regards I found it very easy to learn and work with PASM.· It is not nearly as confusing as ASM for the other micros I have played with (Atmel).· I suspect the really big difference has to do with registers, on the Atmel, it appears you have very specific registers to hold very specific data or results.· With PASM, that confusion went away very quickly and I was able to move forward fairly quickly.· Without any ASM history to compare with I can only say that where I failed with other micros using ASM, I got through it and was able to do some cool stuff with PASM.
I suspect that once you start to mess with it, you are going to fall in love with it - I know I did.
Chris
We are all happy to help you with PASM; I'm as qualified as the next guy, and will help when I see value in it. Most of your Spin programs were like fingernails on a chalkboard to me though, so I just left the room instead of trying to help and for that I apologize. That is why I decided to speak up this time; for this I am not sorry and will never be.
To your credit, your Spin programs did end up better than they started. Yes, I realized early on that you were not a programmer, but to paraphrase what I said before, as long as you have enough knowledge to add value, it is of some advantage be a beginner in writing to teach something to the hopeful masses ... it's easier to relate to the intended audience when walking in their footsteps.
The question is not whether you can learn PASM. I'm sure you can become proficient given enough time. Some day you will have enough working knowledge. At least one potential co-author has already contributed to posts here ... if you ask him, perhaps he will oblige if there is time for it.
There are obviously others who could help you climb your mountain, and there are several greedy enough to dig in and help push you up the slopes ... just beware of such enthusiasm at the summit [noparse]:)[/noparse].
Sincerely,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
Once I get a working program and post it I'll be looking for expert commentary and inexpert help
Lets see how long it takes me to pass muster.
As for the other posters, thanks for the encouragement, I needed every bit.
And I'll try not to let the newbies down.
Harprit