I'm so confused about the location of program counter (R0) and stack pointer(R1) in the memory map.I think they are inside the CPU,so there is not any location inside memory map that shows these registers.But my friend insists that they are located at special function registers(SFR) that is they are located at the bottom of the memory map.Which one is the right answer?
-
I think your friend is confusing the msp430 with the 8051. – old_timer Dec 27 '11 at 22:27
1 Answers
The registers R0 and R1 (and all the other general purpose registers) reside within the CPU and are accessed using instructions that use the "register mode" for an operand. They are not memory mapped.
Special Function Registers are defined in the device specific data sheet for the MSP430 variant you are using. The SFRs typically include interrupt enable bits and interrupt flag bits for devices that directly affect the execution of the CPU (such as NMI, oscillator fault, etc and the first serial port) but do not normally include other general purpose peripherals.
For example, see "Figure 3-1: CPU Block Diagram" in the MSP430x2xx Family Users Guide, SAU144H. The registers are shown as part of the CPU.
Also as an example, see page 14 of the MSP430F2619-HT device specific datasheet which shows the specifal function registers. No mention of the general purpose registers.
- 6,348
- 1
- 30
- 43