I'm getting started with the MPS430 processor via the LaunchPad kit and have a number of basic questions. I do not have much microcontroller experience although I'm a software developer and did some 8088 programming decades ago. If there is a more appropriate forum than this please direct me.
To help me get familiar with the processor, I'm trying to "hand assemble" simple code snippets into machine code. But the documentation is driving me batty. I'm mainly looking at the "MSP430x2xx Family Guide" documentation.
Here are some starting questions if anyone can help answer:
1. Why is it named "MSP430x2xx" -- how do we know what processors that refers to? There is no list in the guide itself. The LaunchPad comes with the MSP430G2231 processor for example. Wouldn't that be a "MSP430x2xxx" classification? Or is the G dropped? How does that classification work?
2. How do you find the actual instruction op codes in the "MSP430x2xx Family Guide" documentation? There is a section: "3.4.5 Instruction Set Description" with figure 3-20 called the "Core Instruction Map". This is the closest thing I can find that might indicate the op codes, but I'll be darned if I can figure it out. For example, for the "jump" instructions, there are a bunch of values such as 20xx, 24xx, 28xx, etc. I can't understand how to relate these values to the instruction fields depicted in section "3.4.3 Jumps" which shows a 3 bit op-code field, then a mysterious 3-bit field called "C", followed by the 10-bit PC Offset.
Comment: I have deduced that the manual is organized to make it easy to update and modify for different processors, by "factoring out" redundant information. However, this makes the manual really hard to use. It would be helpful for example if each instruction listed its op code in the main instruction reference, or if there were at least a simple list of op codes corresponding to the instructions.
3. Symbolic Mode addressing.
The manual makes it difficult to distinguish "Assembly Code" from "(pseudo) machine code" in section 3.3. For each mode, it shows an example of "Assembler Code" and something called "Content of ROM" which seems to be a translation into pseudo machine code, or perhaps better termed "core instruction format". I'm deducing that "Symbolic Mode" addressing is not an actual CPU concept but more an Assembler concept. It does seem to use a special case of "Indexed Mode" or even "Indirect Autoincrement Mode" where the PC is the indexing register. From a CPU concept standpoint, the word "Symbolic" has no meaning.
But the documentation for this mode is not clear. It describes the source address as (contents of PC + X) and the destination address as (contents of PC + Y), but the example seems to indicate the source address as (contents of PC + 1 + X) and the destination address as (contents of PC + 2 + Y). In other words, the words following the PC counter address are added to their own address, not the PC counter.
Those are some starting questions which I would appreciate some insight into.
-SB