Beginner assembly options
TC
Posts: 1,019
I just won a SX Tech Board (Thank You Parallax!!!!). But I have a problem; I have never worked with assembly language before. Now I do have a Propeller stick that I have not really worked with.
My question is what would be my best option to learn assembly on? And what books should I look up.
To me I think the prop would be a good choice because of the forum support.
Thanks TC
My question is what would be my best option to learn assembly on? And what books should I look up.
To me I think the prop would be a good choice because of the forum support.
Thanks TC
Comments
BTW, I love your avatar! I hope the dog and the crab didn't actually tangle. Those claws can really hurt. What kind of crab is that? It has much bigger claws (the left one, anyway) than the Dungeness variety we get around here. Other than that, it looks like a Dungeness. A mutant, perhaps?
-Phil
I found the picture along time ago, so i have no idea about the dog or the crab. i just thought that dog has a bigger set of coconuts than I would to get that close to somthing like that.
And I thought my signature would be a perfect fit.
-Phil
I do like SX/B but I want to learn assembly.
With the SXes, it is still worth learning - but do you have the right resources? Of course I assume you have an SX Key or SX Blitz. And there is a website called www.sxlist.com that may stick around to offer some ideas.
But the real important resource is Gunther's text. You likely need a copy of that to move ahead with some comfort.
It has been difficult for me to accept that the SXes are at EOL and I've stocked up on an extra SX-Key and am willing to go ahead on my own. But it is really unfair to tell a newbie that they should start at such a position.
With the Propeller there is a very lively group that will help out.
I just bought Gunthers book and 2 SX's before they disappear and people are forced to go to there local corner pharmacist to see if he has a SX28AC.
I would like to apologize up front for any ignorance or obvious solutions to the questions that i will ask while I am learning.
In other words, all your efforts to learn SX/ASM are likely to be useful and transferable to Microchip products with some minor differences is Assembler mnemonics.
Aside from Gunther's text, there is a Senix pdf that is a guideline for programing with ISRs (interrupt service routines) as Virtual Peripherals. I believe you can still download that from Parallax and you should take a good look at it and keep it for future study.
Because of the 8 bits, the SXes have paged EEPROM memory and RAM that is divided into segments as well. So unlike the Propeller, there are some housekeeping chores to use all of it.
Like what? Well, the processor is 8 bits, but the program memory have addresses that go beyond the 8bit boundary. So a second register has to provide a pointer to which page. Similarly, to get more RAM, another special register points to segmented RAM as well. Wisely, their is also some global RAM that can be used no matter where the RAM pointer is and that includes all the special registers and the I/O Ports. But, you generally have to keep the two pointers in mind as you create programs. On the Propeller, you don't have to deal with such complexities as addresses are more directly handled, each Cog has a 2K space that is directly addressed by 9bits.
I'll stop here as I am sure Gunther explains the details better that I ever might do so. But those two factors and the ISR are the features that are so different from the Propeller (The Propeller doesn't use ISRs).
Success with the SX is all about the clever use of its ultrafast deterministic interrupt. And a WHOLE LOT can be done there. I've written applications where the ISR took six or seven pages of flowcharts (in Visio) to document what it was doing.
Once that's all packed away, the rest of the coding is a breeze.
@User Name. I too am having trouble understanding spin, but I am not letting that stop me.
@kwinn. Where can I find info on PASD? Tried googling it and came up with info for a school district.
When you learn ASM on the prop, please write a book so I can learn it too!
Mostly people just understand WAITCNT, but the WAITVID is at the core of video timing. And then there are the other two wait commands.
In the SX environment, you would create your own delays, or you would use the ISR cyclical waits. The two approaches seem nearly diametric opposites to me.
The 'other thing' with the Propeller is that it has so much more to offer than you end up just spending a lot more time pondering the potential of every aspects. The best thing is to just jump in and try to make something work. And then ponder why.
A primary designed-in advantage of the Prop is that with eight separate core CPU's that don't have interrupts at all, you don't have to do things like this to get the same kind of results.
@Loopy Byteloose: That is why I have decided to start learning with the SX (only one thing at a time) then after I get a handle on it I will advance to the prop. I have an idea for my first project, an M&M sorter.
Understood. In those applications where my limited knowledge of SPIN and PASM have sufficed, the Prop has been a minor miracle! Or a major miracle! I really love the way multiple processors provide virtually independent functionality, even in the case of very intensive tasks like VGA generation.
Then, a couple months later, I look at my Propeller code and it's like someone else wrote it. Much of it completely baffles me, and it takes me almost as long to figure out what I did as it did to write it in the first place.
In contrast, I can look at SX assembly programs I wrote 10 years ago and understand almost every detail. I can dive right in, making changes or copying and pasting pieces into another project.
The difference is that I have the SX memorized - partly because it's such a simple chip. I doubt I'll ever have SPIN and PASM memorized. There are just too many details. I'll forever be plowing through the wordy manual trying to find what I need, or staring at confusing code trying to figure out even the simple stuff.
Most of the coding examples I see posted on the Propeller forum are totally Greek to me.
Certainly ISRs can become very complex, but often a simple ISR willl suffice.
Spin does have some depth and serious differences from everything else, but for most purposes you don't need full speed or optimization so you can afford to use the subset that's easily associated with your other experience and dive into the manual mainly when you need an extra boost or byte of Hub RAM.
Anyway, like you said so well, there is a subset of SPIN that is easily associated with prior experience, and on the strength of that, folks like me get by.
As for PASM, it may turn out to be as easy and useful as SX assembly. What's needed is a massive project that forces me to get busy using it.