Opening the black box. Registers, Memory, and how data moves between them.
In MSP430, we don't have separate registers for data, addresses, or indexes.
R0-R3 are special.
R4-R15 are identical general-purpose workers.
Why waste a cycle fetching the number "1" from memory? R2 and R3 can pretend to be these numbers instantly:
Code, Data, and Hardware Registers all live in the same address space.
If you write to 0x1C00, you store data in RAM.
If you write to 0x0202, you might turn on an LED!
Lower byte stored at lower address.
How do we get data from A to B? Explore the 7 modes.
The MSP430 is simple. It only has 27 native instructions to learn.
The assembler supports 24 "fake" instructions to simplify coding. It translates them into native ones using Constant Generators (R2/R3) or clever register combinations.
*Shown: 16 most common. Others include DINT, EINT, SETC, CLRN, etc.
"It's complicated. It's a modern hybrid."
ADD @R5, 4(R6). Direct memory-to-memory math!
The MSP430 uses 16-bit instructions. There are only three main ways to format them.