| written 7.4 years ago by |
MSP 430 has 16 registers of which 3 are dedicated function registers and remaining are general purpose registers.
R0 – R3 are Dedicated functions registers.
R4 – R15 are General Purpose registers.

i) PC- program counter:
It can be addressed instructions in address mode.
ii) SP- stack pointer:
Always aligned to even addresses.

Operation of Stack Pointer can be explained as follows:

iii) Status register- SR/ R2
It stores status of result of arithmetic or logical operation.

The status register has following fields.
C - carry bit:
Set -Carry is generated; Clear- no carryZ - zero bit:
Set- result is zero; Clear- result is not zeroN - negative:
Set- result is negative; Clear- result is non-negativeGIE - general interrupt enable
Set- enables maskable interrupt; Clear- all maskable interrupts are disabledCPU off - set when CPU turns off
OSC OFF- oscillator off; Set- turns of LFXT1 crystal oscillator when LFXT1 CLK is not used for MCLK or SMCLK.
SCG0 - system clock generator 0; Set- turns of the FLL+ loop control
SCG1- system clock generator 1; Set- turns off DCO DC generator, if DCO CLK is not used for MCLK or SMCLK.
iv) Constant generator CG1/ CG2 (R2/R3)
- Depending on source register addressing mode (As) new value, 6 commonly used constants can be generated without a code word or code memory access to retrieve them.
- Powerful feature allows the implementation of emulated instruction.
| Register | As | Constant | Remarks |
|---|---|---|---|
| R2 | 00 | -- | Register mode |
| R2 | 01 | (0) | Absolute mode |
| R2 | 10 | 00004h | +4, bit processing |
| R2 | 11 | 00008h | +8, bit processing |
| R3 | 00 | 00000h | 0, word processing |
| R3 | 01 | 00001h | +1 |
| R3 | 10 | 00002h | +2, bit processing |
| R3 | 11 | 0FFFFh | -1, word processing |
v) General purpose registers: R4-R15
To store data values, address pointers, or index values.
They can be accessed by byte or Word instruction.

and 5 others joined a min ago.