written 6.6 years ago by | • modified 6.6 years ago |
The MSP430 CPU incorporates sixteen 16-bit registers:
• Four registers (R0, R1, R2 and R3) have dedicated functions • 12 working registers (R4 to R15) for general use.
R0: Program Counter (PC) • The 16-bit Program Counter (PC/R0) points to the next instruction to be read from memory and executed by the CPU. • The PC is aligned at even addresses, because the instructions are 16 bits, even though the individual memory addresses contain 8-bit values.
R1: Stack Pointer (SP) • The Stack Pointer (SP/R1) is located in R1. • Stack can be used by user to store data for later use (instructions: store by PUSH, retrieve by POP). • Stack can be used by user or by compiler for subroutine parameters (PUSH, POP in calling routine) or by interrupt.
R2: Status Register (SR) • The Status Register (SR/R2) stores the state and control bits. • The system flags are changed automatically by the CPU depending on the result of an operation in a register.
R2/R3: Constant Generator Registers (CG1/CG2) • Depending of the source-register addressing modes (As) value, six commonly used constants can be generated without a code word or code memory access to retrieve them.
R4 - R15: General–Purpose Registers • These general-purpose registers are used to store data values, address pointers, or index values and can be accessed with byte or word instructions.